Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.3] Optimized EagerThreadPoolExecutorTest by decreasing maximumPoolSize #15205

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ void testEagerThreadPoolFast() {
String name = "eager-tf";
int queues = 5;
int cores = 5;
int threads = 10;
// github actions usually run on 4 cores which could be determined by LoadStatusCheckerTest
int threads = 5;
// alive 1 second
long alive = 1000;

Expand All @@ -127,7 +128,7 @@ void testEagerThreadPoolFast() {
taskQueue.setExecutor(executor);

CountDownLatch countDownLatch1 = new CountDownLatch(1);
for (int i = 0; i < 10; i++) {
for (int i = 0; i < 5; i++) {
executor.execute(() -> {
try {
countDownLatch1.await();
Expand All @@ -136,8 +137,8 @@ void testEagerThreadPoolFast() {
}
});
}
await().until(() -> executor.getPoolSize() == 10);
Assertions.assertEquals(10, executor.getActiveCount());
await().until(() -> executor.getPoolSize() == 5);
Assertions.assertEquals(5, executor.getActiveCount());

CountDownLatch countDownLatch2 = new CountDownLatch(1);
AtomicBoolean started = new AtomicBoolean(false);
Expand All @@ -153,8 +154,8 @@ void testEagerThreadPoolFast() {
}

await().until(() -> executor.getQueue().size() == 5);
Assertions.assertEquals(10, executor.getActiveCount());
Assertions.assertEquals(10, executor.getPoolSize());
Assertions.assertEquals(5, executor.getActiveCount());
Assertions.assertEquals(5, executor.getPoolSize());
Assertions.assertFalse(started.get());
countDownLatch1.countDown();

Expand Down
Loading