You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@solr.apache.org by jb...@apache.org on 2023/09/18 15:49:12 UTC

[solr] branch SOLR-16931 created (now 76e5790a12c)

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

jbernste pushed a change to branch SOLR-16931
in repository https://gitbox.apache.org/repos/asf/solr.git


      at 76e5790a12c Randomize debug param in test

This branch includes the following new commits:

     new 76e5790a12c Randomize debug param in test

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[solr] 01/01: Randomize debug param in test

Posted by jb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jbernste pushed a commit to branch SOLR-16931
in repository https://gitbox.apache.org/repos/asf/solr.git

commit 76e5790a12c292d147ba0a832445dbd35cf1e5a6
Author: Joel Bernstein <jb...@apache.org>
AuthorDate: Mon Sep 18 11:48:31 2023 -0400

    Randomize debug param in test
---
 .../test/org/apache/solr/search/DistributedReRankExplainTest.java | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/solr/core/src/test/org/apache/solr/search/DistributedReRankExplainTest.java b/solr/core/src/test/org/apache/solr/search/DistributedReRankExplainTest.java
index 7bebbf54410..952eae178b3 100644
--- a/solr/core/src/test/org/apache/solr/search/DistributedReRankExplainTest.java
+++ b/solr/core/src/test/org/apache/solr/search/DistributedReRankExplainTest.java
@@ -19,6 +19,8 @@ package org.apache.solr.search;
 
 import java.lang.invoke.MethodHandles;
 import java.util.Map;
+import java.util.Random;
+
 import org.apache.solr.SolrTestCaseJ4;
 import org.apache.solr.client.solrj.impl.CloudSolrClient;
 import org.apache.solr.client.solrj.request.CollectionAdminRequest;
@@ -75,9 +77,11 @@ public class DistributedReRankExplainTest extends SolrCloudTestCase {
     updateRequest.process(client, COLLECTIONORALIAS);
     client.commit(COLLECTIONORALIAS);
 
+    String[] debugParams = {CommonParams.DEBUG, CommonParams.DEBUG_QUERY};
+    Random random = random();
     ModifiableSolrParams solrParams = new ModifiableSolrParams();
     String reRank = "{!rerank reRankDocs=10 reRankMainScale=0-10 reRankQuery='test_s:hello'}";
-    solrParams.add("q", "test_s:hello").add("debugQuery", "true").add(CommonParams.RQ, reRank);
+    solrParams.add("q", "test_s:hello").add(debugParams[random.nextInt(2)], "true").add(CommonParams.RQ, reRank);
     QueryRequest queryRequest = new QueryRequest(solrParams);
     QueryResponse queryResponse = queryRequest.process(client, COLLECTIONORALIAS);
     Map<String, Object> debug = queryResponse.getDebugMap();
@@ -88,7 +92,7 @@ public class DistributedReRankExplainTest extends SolrCloudTestCase {
 
     solrParams = new ModifiableSolrParams();
     reRank = "{!rerank reRankDocs=10 reRankScale=0-10 reRankQuery='test_s:hello'}";
-    solrParams.add("q", "test_s:hello").add("debug", "true").add(CommonParams.RQ, reRank);
+    solrParams.add("q", "test_s:hello").add(debugParams[random.nextInt(2)], "true").add(CommonParams.RQ, reRank);
     queryRequest = new QueryRequest(solrParams);
     queryResponse = queryRequest.process(client, COLLECTIONORALIAS);
     debug = queryResponse.getDebugMap();