SOLR-11591: Change the test to not run into the race condition identified until we fix it

This commit is contained in:
Shalin Shekhar Mangar 2017-11-01 19:48:00 +05:30
parent 1b8747ec4f
commit 44b7bc0177
1 changed files with 5 additions and 1 deletions

View File

@ -85,7 +85,11 @@ public class AutoAddReplicasIntegrationTest extends SolrCloudTestCase {
List<Replica> replacedHdfsReplicas = getReplacedSharedFsReplicas(COLLECTION1, zkStateReader, lostNodeName); List<Replica> replacedHdfsReplicas = getReplacedSharedFsReplicas(COLLECTION1, zkStateReader, lostNodeName);
lostJetty.stop(); lostJetty.stop();
waitForNodeLeave(lostNodeName); waitForNodeLeave(lostNodeName);
waitForState("Waiting for collection " + COLLECTION1, COLLECTION1, clusterShape(2, 2)); // ensure that 2 shards have 2 active replicas and only 4 replicas in total
// i.e. old replicas have been deleted.
// todo remove the condition for total replicas == 4 after SOLR-11591 is fixed
waitForState("Waiting for collection " + COLLECTION1, COLLECTION1, (liveNodes, collectionState) -> clusterShape(2, 2).matches(liveNodes, collectionState)
&& collectionState.getReplicas().size() == 4);
checkSharedFsReplicasMovedCorrectly(replacedHdfsReplicas, zkStateReader, COLLECTION1); checkSharedFsReplicasMovedCorrectly(replacedHdfsReplicas, zkStateReader, COLLECTION1);
lostJetty.start(); lostJetty.start();
assertTrue("Timeout waiting for all live and active", ClusterStateUtil.waitForAllActiveAndLiveReplicas(cluster.getSolrClient().getZkStateReader(), 90000)); assertTrue("Timeout waiting for all live and active", ClusterStateUtil.waitForAllActiveAndLiveReplicas(cluster.getSolrClient().getZkStateReader(), 90000));