mirror of
https://github.com/danieldemus/openhab-core.git
synced 2026-07-29 12:34:22 +02:00
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>
This commit is contained in:
+2
-2
@@ -125,7 +125,7 @@ public class ThreadPoolManagerTest {
|
|||||||
ExecutorService threadPool = ThreadPoolManager.getPool(poolName);
|
ExecutorService threadPool = ThreadPoolManager.getPool(poolName);
|
||||||
CountDownLatch cdl = new CountDownLatch(1);
|
CountDownLatch cdl = new CountDownLatch(1);
|
||||||
threadPool.execute(cdl::countDown);
|
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");
|
assertFalse(threadPool.isShutdown(), "Checking if thread pool is not shut down");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -133,7 +133,7 @@ public class ThreadPoolManagerTest {
|
|||||||
ScheduledExecutorService threadPool = ThreadPoolManager.getScheduledPool(poolName);
|
ScheduledExecutorService threadPool = ThreadPoolManager.getScheduledPool(poolName);
|
||||||
CountDownLatch cdl = new CountDownLatch(1);
|
CountDownLatch cdl = new CountDownLatch(1);
|
||||||
threadPool.schedule(cdl::countDown, 100, TimeUnit.MILLISECONDS);
|
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");
|
assertFalse(threadPool.isShutdown(), "Checking if thread pool is not shut down");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user