From 44b7bc017729bf222ed9774d8a3fcd0e0da3231a Mon Sep 17 00:00:00 2001 From: Shalin Shekhar Mangar Date: Wed, 1 Nov 2017 19:48:00 +0530 Subject: [PATCH] SOLR-11591: Change the test to not run into the race condition identified until we fix it --- .../cloud/autoscaling/AutoAddReplicasIntegrationTest.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/solr/core/src/test/org/apache/solr/cloud/autoscaling/AutoAddReplicasIntegrationTest.java b/solr/core/src/test/org/apache/solr/cloud/autoscaling/AutoAddReplicasIntegrationTest.java index 7b1a0c3a524..600cd658cad 100644 --- a/solr/core/src/test/org/apache/solr/cloud/autoscaling/AutoAddReplicasIntegrationTest.java +++ b/solr/core/src/test/org/apache/solr/cloud/autoscaling/AutoAddReplicasIntegrationTest.java @@ -85,7 +85,11 @@ public class AutoAddReplicasIntegrationTest extends SolrCloudTestCase { List replacedHdfsReplicas = getReplacedSharedFsReplicas(COLLECTION1, zkStateReader, lostNodeName); lostJetty.stop(); 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); lostJetty.start(); assertTrue("Timeout waiting for all live and active", ClusterStateUtil.waitForAllActiveAndLiveReplicas(cluster.getSolrClient().getZkStateReader(), 90000));