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

uschindler 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 47c1fdc  SOLR-14758: Fix query execution to pass shards
47c1fdc is described below

commit 47c1fdcfb70d68a4e96da74f61a5b56ebc924f4a
Author: Uwe Schindler <[email protected]>
AuthorDate: Sun Aug 15 13:15:03 2021 +0200

    SOLR-14758: Fix query execution to pass shards
---
 .../component/DistributedQueryComponentCustomSortTest.java   | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git 
a/solr/core/src/test/org/apache/solr/handler/component/DistributedQueryComponentCustomSortTest.java
 
b/solr/core/src/test/org/apache/solr/handler/component/DistributedQueryComponentCustomSortTest.java
index ca7e850..da467c2 100644
--- 
a/solr/core/src/test/org/apache/solr/handler/component/DistributedQueryComponentCustomSortTest.java
+++ 
b/solr/core/src/test/org/apache/solr/handler/component/DistributedQueryComponentCustomSortTest.java
@@ -17,11 +17,14 @@
 package org.apache.solr.handler.component;
 
 import org.apache.solr.BaseDistributedSearchTestCase;
+import org.apache.solr.client.solrj.SolrServerException;
 import org.apache.solr.client.solrj.response.QueryResponse;
+import org.apache.solr.common.params.ModifiableSolrParams;
 import org.apache.solr.response.SolrQueryResponse;
 import org.junit.BeforeClass;
 import org.junit.Test;
 
+import java.io.IOException;
 import java.nio.ByteBuffer;
 import java.util.Objects;
 
@@ -123,9 +126,16 @@ public class DistributedQueryComponentCustomSortTest 
extends BaseDistributedSear
 
     // Regression check on timeAllowed in combination with sorting, SOLR-14758
     // Should see either a complete result or a partial result, but never an 
NPE
-    rsp = queryServer(createParams("q", "text:d", "fl", "id", "sort", "payload 
desc", "rows", "20", "timeAllowed", "1"));
+    rsp = queryAllowPartialResults("q", "text:d", "fl", "id", "sort", "payload 
desc", "rows", "20", "timeAllowed", "1");
     if (!Objects.equals(Boolean.TRUE, 
rsp.getHeader().getBooleanArg(SolrQueryResponse.RESPONSE_HEADER_PARTIAL_RESULTS_KEY)))
 {
       assertFieldValues(rsp.getResults(), id, "11", "13", "12");
     }
   }
+  
+  /** Modified version of {@link 
BaseDistributedSearchTestCase#query(Object...)} that allows partial results. */
+  private QueryResponse queryAllowPartialResults(Object... q) throws 
SolrServerException, IOException {
+    ModifiableSolrParams params = createParams(q);
+    setDistributedParams(params);
+    return queryServer(params);
+  }
 }

Reply via email to