You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by gs...@apache.org on 2021/11/21 15:38:51 UTC

[lucene] branch main updated: Fixup TestCombinedFieldQuery to not (randomy) use numHits = 0

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

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


The following commit(s) were added to refs/heads/main by this push:
     new 9d7e5ef  Fixup TestCombinedFieldQuery to not (randomy) use numHits = 0
9d7e5ef is described below

commit 9d7e5ef38892a43f964afee586dd3dbd1497621e
Author: Greg Miller <gs...@gmail.com>
AuthorDate: Sun Nov 21 07:37:46 2021 -0800

    Fixup TestCombinedFieldQuery to not (randomy) use numHits = 0
---
 .../test/org/apache/lucene/sandbox/search/TestCombinedFieldQuery.java  | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestCombinedFieldQuery.java b/lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestCombinedFieldQuery.java
index 4a18b2c..9460883 100644
--- a/lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestCombinedFieldQuery.java
+++ b/lucene/sandbox/src/test/org/apache/lucene/sandbox/search/TestCombinedFieldQuery.java
@@ -16,7 +16,6 @@
  */
 package org.apache.lucene.sandbox.search;
 
-import static com.carrotsearch.randomizedtesting.RandomizedTest.atMost;
 import static com.carrotsearch.randomizedtesting.RandomizedTest.randomBoolean;
 import static com.carrotsearch.randomizedtesting.RandomizedTest.randomIntBetween;
 
@@ -171,7 +170,7 @@ public class TestCombinedFieldQuery extends LuceneTestCase {
 
   public void testScoringWithMultipleFieldTermsMatch() throws IOException {
     int numMatchDoc = randomIntBetween(100, 500);
-    int numHits = atMost(100);
+    int numHits = randomIntBetween(1, 100);
     int boost1 = Math.max(1, random().nextInt(5));
     int boost2 = Math.max(1, random().nextInt(5));