Improve ThreadPoolManagerTest stability (#4035)

When the CPU load of a system is high these timeouts may not be realistic.

Fixes #3254

Signed-off-by: Wouter Born <github@maindrain.net>
pull/4033/head
Wouter Born 2024-01-12 21:42:02 +01:00 committed by GitHub
parent 18d9b531ff
commit b77f954848
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -125,7 +125,7 @@ public class ThreadPoolManagerTest {
ExecutorService threadPool = ThreadPoolManager.getPool(poolName);
CountDownLatch cdl = new CountDownLatch(1);
threadPool.execute(cdl::countDown);
assertTrue(cdl.await(1, TimeUnit.SECONDS), "Checking if thread pool " + poolName + " works");
assertTrue(cdl.await(5, TimeUnit.SECONDS), "Checking if thread pool " + poolName + " works");
assertFalse(threadPool.isShutdown(), "Checking if thread pool is not shut down");
}
@ -133,7 +133,7 @@ public class ThreadPoolManagerTest {
ScheduledExecutorService threadPool = ThreadPoolManager.getScheduledPool(poolName);
CountDownLatch cdl = new CountDownLatch(1);
threadPool.schedule(cdl::countDown, 100, TimeUnit.MILLISECONDS);
assertTrue(cdl.await(1, TimeUnit.SECONDS), "Checking if thread pool " + poolName + " works");
assertTrue(cdl.await(5, TimeUnit.SECONDS), "Checking if thread pool " + poolName + " works");
assertFalse(threadPool.isShutdown(), "Checking if thread pool is not shut down");
}
}