This is an automated email from the ASF dual-hosted git repository.
albumenj pushed a commit to branch 3.3
in repository https://gitbox.apache.org/repos/asf/dubbo.git
The following commit(s) were added to refs/heads/3.3 by this push:
new 25d68722e3 Optimized EagerThreadPoolExecutorTest by decreasing
maximumPoolSize (#15205)
25d68722e3 is described below
commit 25d68722e3132ea6498353324d06bf7f7f7fcf35
Author: zrlw <[email protected]>
AuthorDate: Thu Mar 6 09:43:37 2025 +0800
Optimized EagerThreadPoolExecutorTest by decreasing maximumPoolSize (#15205)
---
.../support/eager/EagerThreadPoolExecutorTest.java | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git
a/dubbo-common/src/test/java/org/apache/dubbo/common/threadpool/support/eager/EagerThreadPoolExecutorTest.java
b/dubbo-common/src/test/java/org/apache/dubbo/common/threadpool/support/eager/EagerThreadPoolExecutorTest.java
index 9c6afec620..cf8b222634 100644
---
a/dubbo-common/src/test/java/org/apache/dubbo/common/threadpool/support/eager/EagerThreadPoolExecutorTest.java
+++
b/dubbo-common/src/test/java/org/apache/dubbo/common/threadpool/support/eager/EagerThreadPoolExecutorTest.java
@@ -110,7 +110,8 @@ class EagerThreadPoolExecutorTest {
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;
@@ -127,7 +128,7 @@ class EagerThreadPoolExecutorTest {
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();
@@ -136,8 +137,8 @@ class EagerThreadPoolExecutorTest {
}
});
}
- 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);
@@ -153,8 +154,8 @@ class EagerThreadPoolExecutorTest {
}
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();