From b77f95484823730ffd0e8d57e8e9cc3bb1587365 Mon Sep 17 00:00:00 2001 From: Wouter Born Date: Fri, 12 Jan 2024 21:42:02 +0100 Subject: [PATCH] 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 --- .../java/org/openhab/core/common/ThreadPoolManagerTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bundles/org.openhab.core/src/test/java/org/openhab/core/common/ThreadPoolManagerTest.java b/bundles/org.openhab.core/src/test/java/org/openhab/core/common/ThreadPoolManagerTest.java index 60718e26ce..6e968dd825 100644 --- a/bundles/org.openhab.core/src/test/java/org/openhab/core/common/ThreadPoolManagerTest.java +++ b/bundles/org.openhab.core/src/test/java/org/openhab/core/common/ThreadPoolManagerTest.java @@ -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"); } }