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

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


The following commit(s) were added to refs/heads/main by this push:
     new c0e4dfde99d Test fix AnalyticsMergeStrategyTest (#3639)
c0e4dfde99d is described below

commit c0e4dfde99dd714e3305bbd5ed006ec84d11ca93
Author: David Smiley <dsmi...@apache.org>
AuthorDate: Sun Sep 21 00:17:43 2025 -0400

    Test fix AnalyticsMergeStrategyTest (#3639)
    
    A regression.
    Also improved some comments.
---
 .../apache/solr/search/AnalyticsMergeStrategyTest.java    | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git 
a/solr/core/src/test/org/apache/solr/search/AnalyticsMergeStrategyTest.java 
b/solr/core/src/test/org/apache/solr/search/AnalyticsMergeStrategyTest.java
index f8409483bea..c2b25582465 100644
--- a/solr/core/src/test/org/apache/solr/search/AnalyticsMergeStrategyTest.java
+++ b/solr/core/src/test/org/apache/solr/search/AnalyticsMergeStrategyTest.java
@@ -27,9 +27,7 @@ import org.junit.BeforeClass;
 import org.junit.Test;
 
 /**
- * Test for QueryComponent's distributed querying
- *
- * @see org.apache.solr.handler.component.QueryComponent
+ * Tests {@link AnalyticsQuery} and {@link 
org.apache.solr.handler.component.IterativeMergeStrategy}
  */
 @SolrTestCaseJ4.SuppressSSL(bugUrl = 
"https://issues.apache.org/jira/browse/SOLR-8433";)
 @ThreadLeakScope(Scope.NONE)
@@ -64,15 +62,16 @@ public class AnalyticsMergeStrategyTest extends 
BaseDistributedSearchTestCase {
     commit();
 
     /*
-     *  The count qparser plugin is pointing to AnalyticsTestQParserPlugin. 
This class defines a simple AnalyticsQuery and
-     *  has two merge strategies. If the "iterate" local param is true then an 
InteractiveMergeStrategy is used.
+     * The count qparser plugin is pointing to AnalyticsTestQParserPlugin. 
This class defines a
+     * simple AnalyticsQuery and has two merge strategies. If the "iterate" 
local param is true then
+     * an IterativeMergeStrategy is used.
      */
 
     ModifiableSolrParams params = new ModifiableSolrParams();
     params.add("q", "*:*");
     params.add("fq", "{!count}");
     setDistributedParams(params);
-    QueryResponse rsp = query(params);
+    QueryResponse rsp = queryRandomShard(params);
     assertCount(rsp, 11);
 
     // Test IterativeMergeStrategy
@@ -80,14 +79,14 @@ public class AnalyticsMergeStrategyTest extends 
BaseDistributedSearchTestCase {
     params.add("q", "*:*");
     params.add("fq", "{!count iterate=true}");
     setDistributedParams(params);
-    rsp = query(params);
+    rsp = queryRandomShard(params);
     assertCountOnly(rsp, 44);
 
     params = new ModifiableSolrParams();
     params.add("q", "id:(1 2 5 6)");
     params.add("fq", "{!count}");
     setDistributedParams(params);
-    rsp = query(params);
+    rsp = queryRandomShard(params);
     assertCount(rsp, 4);
   }
 

Reply via email to