Skip to content

Commit 42f00ba

Browse files
(cherry picked from commit 10fc755) Signed-off-by: kkewwei <kkewwei@163.com> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent f96669a commit 42f00ba

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

server/src/test/java/org/opensearch/cluster/service/TaskBatcherTests.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,8 @@ public void testTasksAreExecutedInOrder() throws BrokenBarrierException, Interru
218218
executors[i] = new TaskExecutor();
219219
}
220220

221-
int tasksSubmittedPerThread = randomIntBetween(2, 1024);
221+
// it will create at most 8192 threads, which will cause native memory oom. so we limit the number of created threads.
222+
int tasksSubmittedPerThread = randomIntBetween(2, 128);
222223

223224
CopyOnWriteArrayList<Tuple<String, Throwable>> failures = new CopyOnWriteArrayList<>();
224225
CountDownLatch updateLatch = new CountDownLatch(numberOfThreads * tasksSubmittedPerThread);
@@ -286,7 +287,7 @@ public void testNoTasksAreDroppedInParallelSubmission() throws BrokenBarrierExce
286287
executors[i] = new TaskExecutor();
287288
}
288289

289-
int tasksSubmittedPerThread = randomIntBetween(2, 1024);
290+
int tasksSubmittedPerThread = randomIntBetween(2, 128);
290291

291292
CopyOnWriteArrayList<Tuple<String, Throwable>> failures = new CopyOnWriteArrayList<>();
292293
CountDownLatch updateLatch = new CountDownLatch(numberOfThreads * tasksSubmittedPerThread);

0 commit comments

Comments
 (0)