IndexWithShadowReplicasIT.testReplicaToPrimaryPromotion should wait for node leave to be processed
This commit is contained in:
parent
267a7b427b
commit
b9691d15ae
|
@ -291,13 +291,14 @@ public class IndexWithShadowReplicasIT extends ESIntegTestCase {
|
||||||
assertThat(gResp2.getSource().get("foo"), equalTo("bar"));
|
assertThat(gResp2.getSource().get("foo"), equalTo("bar"));
|
||||||
|
|
||||||
// Node1 has the primary, now node2 has the replica
|
// Node1 has the primary, now node2 has the replica
|
||||||
String node2 = internalCluster().startNode(nodeSettings);
|
internalCluster().startNode(nodeSettings);
|
||||||
ensureGreen(IDX);
|
ensureGreen(IDX);
|
||||||
client().admin().cluster().prepareHealth().setWaitForNodes("2").get();
|
client().admin().cluster().prepareHealth().setWaitForNodes("2").get();
|
||||||
flushAndRefresh(IDX);
|
flushAndRefresh(IDX);
|
||||||
|
|
||||||
logger.info("--> stopping node1 [{}]", node1);
|
logger.info("--> stopping node1 [{}]", node1);
|
||||||
internalCluster().stopRandomNode(InternalTestCluster.nameFilter(node1));
|
internalCluster().stopRandomNode(InternalTestCluster.nameFilter(node1));
|
||||||
|
ensureClusterSizeConsistency(); // wait for the new node to be elected and process the node leave
|
||||||
ensureYellow(IDX);
|
ensureYellow(IDX);
|
||||||
|
|
||||||
logger.info("--> performing query");
|
logger.info("--> performing query");
|
||||||
|
|
Loading…
Reference in New Issue