You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by dw...@apache.org on 2021/09/30 07:17:33 UTC

[lucene] branch main updated: Correct test error that allowed an empty array.

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

dweiss 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 0c13a52  Correct test error that allowed an empty array.
0c13a52 is described below

commit 0c13a52df5467f41bf19cb868eebbd7962878967
Author: Dawid Weiss <da...@carrotsearch.com>
AuthorDate: Thu Sep 30 09:17:29 2021 +0200

    Correct test error that allowed an empty array.
---
 .../lucene/facet/taxonomy/directory/TestDirectoryTaxonomyReader.java   | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestDirectoryTaxonomyReader.java b/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestDirectoryTaxonomyReader.java
index 3da0583..cff8dc2 100644
--- a/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestDirectoryTaxonomyReader.java
+++ b/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestDirectoryTaxonomyReader.java
@@ -16,6 +16,7 @@
  */
 package org.apache.lucene.facet.taxonomy.directory;
 
+import com.carrotsearch.randomizedtesting.RandomizedTest;
 import com.carrotsearch.randomizedtesting.generators.RandomNumbers;
 import java.io.IOException;
 import java.util.Arrays;
@@ -572,7 +573,7 @@ public class TestDirectoryTaxonomyReader extends FacetTestCase {
   public void testCallingBulkPathReturnsCorrectResult() throws Exception {
     Directory src = newDirectory();
     DirectoryTaxonomyWriter w = new DirectoryTaxonomyWriter(src);
-    String randomArray[] = new String[random().nextInt(1000)];
+    String randomArray[] = new String[RandomizedTest.randomIntBetween(1, 1000)];
     // adding a smaller bound on ints ensures that we will have some duplicate ordinals in random
     // test cases
     Arrays.setAll(randomArray, i -> Integer.toString(random().nextInt(500)));