From b43f888ce2f5a1c3ddf3a50377e7adf668ff4245 Mon Sep 17 00:00:00 2001 From: brusdev Date: Sun, 10 May 2020 21:08:23 +0200 Subject: [PATCH] ARTEMIS-2755 Add SoakPagingTest timeouts Limit time awaiting producers and consumers. --- .../tests/smoke/replicationflow/SoakPagingTest.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/replicationflow/SoakPagingTest.java b/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/replicationflow/SoakPagingTest.java index b09388b32f..3d791525f2 100644 --- a/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/replicationflow/SoakPagingTest.java +++ b/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/replicationflow/SoakPagingTest.java @@ -28,6 +28,7 @@ import javax.jms.Topic; import java.util.Arrays; import java.util.Collection; import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; import org.apache.activemq.artemis.tests.smoke.common.SmokeTestBase; @@ -157,10 +158,16 @@ public class SoakPagingTest extends SmokeTestBase { } System.out.println("Awaiting producers..."); - producersLatch.await(); + if (!producersLatch.await(30000, TimeUnit.MILLISECONDS)) { + System.err.println("Awaiting producers timeout"); + System.exit(0); + } System.out.println("Awaiting consumers..."); - consumersLatch.await(); + if (!consumersLatch.await(30000, TimeUnit.MILLISECONDS)) { + System.err.println("Awaiting consumers timeout"); + System.exit(0); + } System.out.println("Awaiting timeout..."); Thread.sleep(time);