Skip to content

Commit 50186b2

Browse files
committed
Fix TimeSeriesLifecycleActionsIT
1 parent 48cbca1 commit 50186b2

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

x-pack/plugin/ilm/qa/multi-node/src/test/java/org/elasticsearch/xpack/ilm/TimeSeriesLifecycleActionsIT.java

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1697,18 +1697,14 @@ public void testDeleteActionDoesntDeleteSearchableSnapshot() throws Exception {
16971697
try (InputStream is = getSnapshotsResponse.getEntity().getContent()) {
16981698
snapshotsResponseMap = XContentHelper.convertToMap(XContentType.JSON.xContent(), is, true);
16991699
}
1700-
ArrayList<Object> responses = (ArrayList<Object>) snapshotsResponseMap.get("responses");
1701-
for (Object response : responses) {
1702-
Map<String, Object> responseAsMap = (Map<String, Object>) response;
1703-
if (responseAsMap.get("snapshots") != null) {
1704-
ArrayList<Object> snapshots = (ArrayList<Object>) responseAsMap.get("snapshots");
1705-
for (Object snapshot : snapshots) {
1706-
Map<String, Object> snapshotInfoMap = (Map<String, Object>) snapshot;
1707-
if (snapshotInfoMap.get("snapshot").equals(snapshotName[0]) &&
1708-
// wait for the snapshot to be completed (successfully or not) otherwise the teardown might fail
1709-
SnapshotState.valueOf((String) snapshotInfoMap.get("state")).completed()) {
1710-
return true;
1711-
}
1700+
if (snapshotsResponseMap.get("snapshots") != null) {
1701+
ArrayList<Object> snapshots = (ArrayList<Object>) snapshotsResponseMap.get("snapshots");
1702+
for (Object snapshot : snapshots) {
1703+
Map<String, Object> snapshotInfoMap = (Map<String, Object>) snapshot;
1704+
if (snapshotInfoMap.get("snapshot").equals(snapshotName[0]) &&
1705+
// wait for the snapshot to be completed (successfully or not) otherwise the teardown might fail
1706+
SnapshotState.valueOf((String) snapshotInfoMap.get("state")).completed()) {
1707+
return true;
17121708
}
17131709
}
17141710
}

0 commit comments

Comments
 (0)