Skip to content

Commit ab49a8c

Browse files
committed
improve update test to wait for green cluster state
1 parent 70f212a commit ab49a8c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/test/java/org/elasticsearch/test/integration/update/UpdateTests.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,9 @@ public void testUpdate() throws Exception {
249249
.endObject())
250250
.setRefresh(true)
251251
.execute().actionGet();
252+
clusterHealth = client.admin().cluster().prepareHealth().setWaitForGreenStatus().execute().actionGet();
253+
assertThat(clusterHealth.timedOut(), equalTo(false));
254+
assertThat(clusterHealth.status(), equalTo(ClusterHealthStatus.GREEN));
252255
updateResponse = client.prepareUpdate("test", "type1", "1").setScript("ctx._source.field += 1").setPercolate("*").execute().actionGet();
253256
assertThat(updateResponse.matches().size(), equalTo(1));
254257

0 commit comments

Comments
 (0)