IndexWithShadowReplicasIT.testReplicaToPrimaryPromotion should wait for node leave to be processed

This commit is contained in:
Boaz Leskes 2016-10-28 20:22:24 +02:00
parent 267a7b427b
commit b9691d15ae
1 changed files with 2 additions and 1 deletions

View File

@ -291,13 +291,14 @@ public class IndexWithShadowReplicasIT extends ESIntegTestCase {
assertThat(gResp2.getSource().get("foo"), equalTo("bar"));
// Node1 has the primary, now node2 has the replica
String node2 = internalCluster().startNode(nodeSettings);
internalCluster().startNode(nodeSettings);
ensureGreen(IDX);
client().admin().cluster().prepareHealth().setWaitForNodes("2").get();
flushAndRefresh(IDX);
logger.info("--> stopping node1 [{}]", node1);
internalCluster().stopRandomNode(InternalTestCluster.nameFilter(node1));
ensureClusterSizeConsistency(); // wait for the new node to be elected and process the node leave
ensureYellow(IDX);
logger.info("--> performing query");