Skip to content

Commit

Permalink
fix unit test (#12817) (#12932)
Browse files Browse the repository at this point in the history
(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>
  • Loading branch information
1 parent f96669a commit 42f00ba
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 42f00ba

Please sign in to comment.