improve update test to wait for green cluster state

This commit is contained in:
Shay Banon 2012-08-14 01:47:18 +02:00
parent 70f212a4dc
commit ab49a8c2fc
1 changed files with 3 additions and 0 deletions

View File

@ -249,6 +249,9 @@ public class UpdateTests extends AbstractNodesTests {
.endObject())
.setRefresh(true)
.execute().actionGet();
clusterHealth = client.admin().cluster().prepareHealth().setWaitForGreenStatus().execute().actionGet();
assertThat(clusterHealth.timedOut(), equalTo(false));
assertThat(clusterHealth.status(), equalTo(ClusterHealthStatus.GREEN));
updateResponse = client.prepareUpdate("test", "type1", "1").setScript("ctx._source.field += 1").setPercolate("*").execute().actionGet();
assertThat(updateResponse.matches().size(), equalTo(1));