From 755044b58f984ecadca3096a3572ee261cd96cdf Mon Sep 17 00:00:00 2001 From: markrmiller Date: Sat, 1 Dec 2018 08:08:44 -0600 Subject: [PATCH] SOLR-12801: Wait for collection creation in test. --- .../autoscaling/AutoAddReplicasIntegrationTest.java | 9 ++++++++- 1 file changed, 8 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 5ad5764497b..7b87571c7fa 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 @@ -73,7 +73,6 @@ public class AutoAddReplicasIntegrationTest extends SolrCloudTestCase { } @Test - // This apparently fails in both subclasses. public void testSimple() throws Exception { JettySolrRunner jetty1 = cluster.getJettySolrRunner(0); JettySolrRunner jetty2 = cluster.getJettySolrRunner(1); @@ -83,11 +82,17 @@ public class AutoAddReplicasIntegrationTest extends SolrCloudTestCase { .setAutoAddReplicas(true) .setMaxShardsPerNode(2) .process(cluster.getSolrClient()); + + cluster.waitForActiveCollection(COLLECTION1, 2, 4); + CollectionAdminRequest.createCollection(COLLECTION2, "conf", 2, 2) .setCreateNodeSet(jetty2.getNodeName()+","+jetty3.getNodeName()) .setAutoAddReplicas(false) .setMaxShardsPerNode(2) .process(cluster.getSolrClient()); + + cluster.waitForActiveCollection(COLLECTION2, 2, 4); + // the number of cores in jetty1 (5) will be larger than jetty3 (1) CollectionAdminRequest.createCollection("testSimple3", "conf", 3, 1) .setCreateNodeSet(jetty1.getNodeName()) @@ -95,6 +100,8 @@ public class AutoAddReplicasIntegrationTest extends SolrCloudTestCase { .setMaxShardsPerNode(3) .process(cluster.getSolrClient()); + cluster.waitForActiveCollection("testSimple3", 3, 3); + ZkStateReader zkStateReader = cluster.getSolrClient().getZkStateReader(); // start the tests