diff --git a/src/test/java/org/elasticsearch/test/integration/cluster/MinimumMasterNodesTests.java b/src/test/java/org/elasticsearch/test/integration/cluster/MinimumMasterNodesTests.java index b89d68fc9f830..0e8eb05892b47 100644 --- a/src/test/java/org/elasticsearch/test/integration/cluster/MinimumMasterNodesTests.java +++ b/src/test/java/org/elasticsearch/test/integration/cluster/MinimumMasterNodesTests.java @@ -160,7 +160,9 @@ public void simpleMinimumMasterNodes() throws Exception { logger.info("--> starting the previous master node again..."); startNode(nonMasterNodeName, settings); - clusterHealthResponse = client("node1").admin().cluster().prepareHealth().setWaitForNodes("2").execute().actionGet(); + Thread.sleep(200); + + clusterHealthResponse = client("node1").admin().cluster().prepareHealth().setWaitForNodes("2").setWaitForGreenStatus().execute().actionGet(); assertThat(clusterHealthResponse.timedOut(), equalTo(false)); state = client("node1").admin().cluster().prepareState().setLocal(true).execute().actionGet().state();