jpountz commented on code in PR #12369:
URL: https://github.com/apache/lucene/pull/12369#discussion_r1229481989


##########
lucene/test-framework/src/java/org/apache/lucene/tests/util/LuceneTestCase.java:
##########
@@ -1941,7 +1940,7 @@ public static IndexSearcher newSearcher(
     } else {
       int threads = 0;
       final ThreadPoolExecutor ex;
-      if (r.getReaderCacheHelper() == null || random.nextBoolean()) {
+      if (r.getReaderCacheHelper() == null || rarely()) {

Review Comment:
   I'd prefer to keep this one a `random.nextBoolean()` as the semantics of 
`useThreads` to me are about whether the test _may_ use threads. The point is 
to allow some tests to disable threading by passing `useThreads = false`.



##########
lucene/test-framework/src/java/org/apache/lucene/tests/util/LuceneTestCase.java:
##########
@@ -1965,9 +1966,9 @@ public static IndexSearcher newSearcher(
             .addClosedListener(cacheKey -> 
TestUtil.shutdownExecutorService(ex));
       }
       IndexSearcher ret;
+      int maxDocPerSlice = random.nextBoolean() ? 1 : 1 + random.nextInt(1000);
+      int maxSegmentsPerSlice = random.nextBoolean() ? 1 : 1 + 
random.nextInt(10);

Review Comment:
   It looks ok to me, worst-case scenario it will create one slice per segment, 
which shouldn't be an adversarial case.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to