From b82419634ab5bcd9069d5bce09e554ca4a82b4b8 Mon Sep 17 00:00:00 2001 From: Justin Bertram Date: Fri, 23 Jun 2023 09:10:44 -0500 Subject: [PATCH] ARTEMIS-4328 add timeout to test which can hang `org.apache.activemq.artemis.core.server.embedded.MainTest` expects the broker to throw a `java.io.IOException` when it is started due to its inability to find the file app/data/server.lock. However, if that files just happens to exist then the test will simply hang indefinitely. This commit adds a timeout to avoid hanging. --- .../apache/activemq/artemis/core/server/embedded/MainTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/core/server/embedded/MainTest.java b/artemis-server/src/test/java/org/apache/activemq/artemis/core/server/embedded/MainTest.java index 92e1d532ac..3ff3291755 100644 --- a/artemis-server/src/test/java/org/apache/activemq/artemis/core/server/embedded/MainTest.java +++ b/artemis-server/src/test/java/org/apache/activemq/artemis/core/server/embedded/MainTest.java @@ -23,7 +23,7 @@ import org.junit.Test; public class MainTest { - @Test(expected = IOException.class) + @Test(expected = IOException.class, timeout = 5000) public void testNull() throws Exception { Main.main(new String[]{}); }