test: wait for index to be green before running all checks
This commit is contained in:
parent
5189bd14f1
commit
9040f4498e
|
@ -149,6 +149,17 @@ public class FullClusterRestartIT extends ESRestTestCase {
|
||||||
} else {
|
} else {
|
||||||
count = countOfIndexedRandomDocuments();
|
count = countOfIndexedRandomDocuments();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Map<String, String> params = new HashMap<>();
|
||||||
|
params.put("timeout", "2m");
|
||||||
|
params.put("wait_for_status", "green");
|
||||||
|
params.put("wait_for_no_relocating_shards", "true");
|
||||||
|
params.put("wait_for_events", "languid");
|
||||||
|
Map<String, Object> healthRsp = toMap(client().performRequest("GET", "/_cluster/health/" + index, params));
|
||||||
|
logger.info("health api response: {}", healthRsp);
|
||||||
|
assertEquals("green", healthRsp.get("status"));
|
||||||
|
assertFalse((Boolean) healthRsp.get("timed_out"));
|
||||||
|
|
||||||
assertBasicSearchWorks(count);
|
assertBasicSearchWorks(count);
|
||||||
assertAllSearchWorks(count);
|
assertAllSearchWorks(count);
|
||||||
assertBasicAggregationWorks();
|
assertBasicAggregationWorks();
|
||||||
|
|
Loading…
Reference in New Issue