Skip to content

Commit

Permalink
fix unit test (opensearch-project#12817)
Browse files Browse the repository at this point in the history
Signed-off-by: kkewwei <kkewwei@163.com>
Signed-off-by: Shivansh Arora <hishiv@amazon.com>
  • Loading branch information
kkewwei authored and shiv0408 committed Apr 25, 2024
1 parent de29330 commit 14aac37
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,8 @@ public void testTasksAreExecutedInOrder() throws BrokenBarrierException, Interru
executors[i] = new TaskExecutor();
}

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

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

int tasksSubmittedPerThread = randomIntBetween(2, 1024);
int tasksSubmittedPerThread = randomIntBetween(2, 128);

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

0 comments on commit 14aac37

Please sign in to comment.