This is an automated email from the ASF dual-hosted git repository.

dsmiley pushed a commit to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/solr.git

commit a9f697c28fe31a708e55d0f99c5c9ce87aef607b
Author: Matthew Biscocho <[email protected]>
AuthorDate: Mon May 25 09:21:02 2026 -0400

    Test fix testDistributedQueryDoesNotReadFromZk  (#4429)
    
    My suspicion is that there is a race condition making it flaky where the 
jetty node has not yet seen the updated state of the collection that it is 
ready but the client has because we were waiting on separate zkStateReader 
which is separate from the cached state from the actually jetty node and 
collection. So instead, we wait on that jetty nodes ready state using it's 
zkStateReader and not clients.
---
 .../component/DistributedQueryComponentOptimizationTest.java      | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

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 7b65c88caac..02bcb11a84b 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
@@ -728,7 +728,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,
@@ -739,7 +744,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 
Http2SolrClient.Builder(nodeWithoutSecondColl.getBaseUrl().toString()).build()) 
{
 

Reply via email to