Skip to content

Commit 8c161e6

Browse files
committed
tests: decrease maximum number of threads in seq number test to avoid OOM
These nightly tests may use a large amount of threads, which multiplies the workload. In general for the concurrency tests, a small number of threads should be enough, large numbers of threads probably just find more resource issues rather than bang for the buck.
1 parent 36b3577 commit 8c161e6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lucene/core/src/test/org/apache/lucene/index/TestIndexingSequenceNumbers.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public void testStressUpdateSameID() throws Exception {
7878
for (int iter = 0; iter < iters; iter++) {
7979
Directory dir = newDirectory();
8080
final RandomIndexWriter w = new RandomIndexWriter(random(), dir);
81-
Thread[] threads = new Thread[TestUtil.nextInt(random(), 2, 5)];
81+
Thread[] threads = new Thread[TestUtil.nextInt(random(), 2, 4)];
8282
final CountDownLatch startingGun = new CountDownLatch(1);
8383
final long[] seqNos = new long[threads.length];
8484
final Term id = new Term("id", "id");
@@ -156,7 +156,7 @@ public void testStressConcurrentCommit() throws Exception {
156156
// Cannot use RIW since it randomly commits:
157157
final IndexWriter w = new IndexWriter(dir, iwc);
158158

159-
final int numThreads = TestUtil.nextInt(random(), 2, 10);
159+
final int numThreads = TestUtil.nextInt(random(), 2, 4);
160160
Thread[] threads = new Thread[numThreads];
161161
// System.out.println("TEST: iter=" + iter + " opCount=" + opCount + " idCount=" + idCount + "
162162
// threadCount=" + threads.length);
@@ -353,7 +353,7 @@ public void testStressConcurrentDocValuesUpdatesCommit() throws Exception {
353353
// Cannot use RIW since it randomly commits:
354354
final IndexWriter w = new IndexWriter(dir, iwc);
355355

356-
final int numThreads = TestUtil.nextInt(random(), 2, 10);
356+
final int numThreads = TestUtil.nextInt(random(), 2, 4);
357357
if (VERBOSE) {
358358
System.out.println("TEST: numThreads=" + numThreads);
359359
}
@@ -538,7 +538,7 @@ public void testStressConcurrentAddAndDeleteAndCommit() throws Exception {
538538
// Cannot use RIW since it randomly commits:
539539
final IndexWriter w = new IndexWriter(dir, iwc);
540540

541-
final int numThreads = TestUtil.nextInt(random(), 2, 5);
541+
final int numThreads = TestUtil.nextInt(random(), 2, 4);
542542
Thread[] threads = new Thread[numThreads];
543543
// System.out.println("TEST: iter=" + iter + " opCount=" + opCount + " idCount=" + idCount + "
544544
// threadCount=" + threads.length);

0 commit comments

Comments
 (0)