Skip to content

Commit

Permalink
improve test, wait for green state post master node startup
Browse files Browse the repository at this point in the history
  • Loading branch information
kimchy committed Feb 1, 2012
1 parent 83e561d commit a5838dc
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit a5838dc

Please sign in to comment.