Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

Test fix testDistributedQueryDoesNotReadFromZk (#4429)

Matthew Biscocho3dd8e62b7593
diff --git a/solr/core/src/test/org/apache/solr/handler/component/DistributedQueryComponentOptimizationTest.java b/solr/core/src/test/org/apache/solr/handler/component/DistributedQueryComponentOptimizationTest.java
index 9387d8680b7..04edcd9c7f9 100644
--- a/solr/core/src/test/org/apache/solr/handler/component/DistributedQueryComponentOptimizationTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/component/DistributedQueryComponentOptimizationTest.java
@@ -724,7 +724,12 @@ public class DistributedQueryComponentOptimizationTest extends SolrCloudTestCase
CollectionAdminRequest.createCollection(secondColl, "conf", 1, 1)
.setCreateNodeSet(jettys.get(0).getNodeName())
.processAndWait(cluster.getSolrClient(), DEFAULT_TIMEOUT);
- cluster
+
+ // Wait on node 1's ZkStateReader (not the cluster client's) to check for ready state
+ JettySolrRunner nodeWithoutSecondColl = jettys.get(1);
+ nodeWithoutSecondColl
+ .getCoreContainer()
+ .getZkController()
.getZkStateReader()
.waitForState(
secondColl,
@@ -735,7 +740,6 @@ public class DistributedQueryComponentOptimizationTest extends SolrCloudTestCase
try {
// Node 1 hosts COLLECTION but not secondColl.
// Send a multi-collection query to trigger LazyCollectionRef get call
- JettySolrRunner nodeWithoutSecondColl = jettys.get(1);
try (SolrClient client =
new HttpJettySolrClient.Builder(nodeWithoutSecondColl.getBaseUrl().toString()).build()) {