From e959e3cfe84ea2780a9f4cbc58f0f36919e8b06d Mon Sep 17 00:00:00 2001 From: Clebert Suconic Date: Wed, 17 May 2023 09:56:52 -0400 Subject: [PATCH] ARTEMIS-4279 Improving BAD JDBC Configuration Test Test was intermittently failing. It does not matter the return code, as long as the process is not alive --- .../artemis/tests/smoke/jdbc/JdbcStartupTest.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/jdbc/JdbcStartupTest.java b/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/jdbc/JdbcStartupTest.java index f77ee542a4..519d8da0ec 100644 --- a/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/jdbc/JdbcStartupTest.java +++ b/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/jdbc/JdbcStartupTest.java @@ -19,25 +19,28 @@ package org.apache.activemq.artemis.tests.smoke.jdbc; import org.apache.activemq.artemis.tests.smoke.common.SmokeTestBase; import org.junit.Assert; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import java.util.concurrent.TimeUnit; public class JdbcStartupTest extends SmokeTestBase { + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); + protected static final String SERVER_NAME = "jdbc-bad-driver"; @Test public void startupBadJdbcConnectionTest() throws Exception { - Integer exitVal = -1; Process p = startServer(SERVER_NAME, 0, 0); try { - p.waitFor(10, TimeUnit.SECONDS); - exitVal = p.exitValue(); + p.waitFor(20, TimeUnit.SECONDS); + Assert.assertFalse(p.isAlive()); } catch (Exception e) { - Assert.fail(); + logger.warn(e.getMessage(), e); + Assert.fail(e.getMessage()); } - - Assert.assertEquals(0, (long) exitVal); } }