mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-06-30 10:23:41 -04:00
Fix TimeSeriesLifecycleActionsIT
This commit is contained in:
parent
48cbca1de4
commit
50186b2580
1 changed files with 8 additions and 12 deletions
|
@ -1697,18 +1697,14 @@ public class TimeSeriesLifecycleActionsIT extends ESRestTestCase {
|
||||||
try (InputStream is = getSnapshotsResponse.getEntity().getContent()) {
|
try (InputStream is = getSnapshotsResponse.getEntity().getContent()) {
|
||||||
snapshotsResponseMap = XContentHelper.convertToMap(XContentType.JSON.xContent(), is, true);
|
snapshotsResponseMap = XContentHelper.convertToMap(XContentType.JSON.xContent(), is, true);
|
||||||
}
|
}
|
||||||
ArrayList<Object> responses = (ArrayList<Object>) snapshotsResponseMap.get("responses");
|
if (snapshotsResponseMap.get("snapshots") != null) {
|
||||||
for (Object response : responses) {
|
ArrayList<Object> snapshots = (ArrayList<Object>) snapshotsResponseMap.get("snapshots");
|
||||||
Map<String, Object> responseAsMap = (Map<String, Object>) response;
|
for (Object snapshot : snapshots) {
|
||||||
if (responseAsMap.get("snapshots") != null) {
|
Map<String, Object> snapshotInfoMap = (Map<String, Object>) snapshot;
|
||||||
ArrayList<Object> snapshots = (ArrayList<Object>) responseAsMap.get("snapshots");
|
if (snapshotInfoMap.get("snapshot").equals(snapshotName[0]) &&
|
||||||
for (Object snapshot : snapshots) {
|
// wait for the snapshot to be completed (successfully or not) otherwise the teardown might fail
|
||||||
Map<String, Object> snapshotInfoMap = (Map<String, Object>) snapshot;
|
SnapshotState.valueOf((String) snapshotInfoMap.get("state")).completed()) {
|
||||||
if (snapshotInfoMap.get("snapshot").equals(snapshotName[0]) &&
|
return true;
|
||||||
// wait for the snapshot to be completed (successfully or not) otherwise the teardown might fail
|
|
||||||
SnapshotState.valueOf((String) snapshotInfoMap.get("state")).completed()) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue