You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "jpountz (via GitHub)" <gi...@apache.org> on 2023/06/14 11:56:21 UTC
[GitHub] [lucene] jpountz commented on a diff in pull request #12369: Increased the likelihood of leveraging inter-segment concurrency in tests
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-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org