This is an automated email from the ASF dual-hosted git repository.
clebertsuconic pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/activemq-artemis.git
The following commit(s) were added to refs/heads/main by this push:
new e959e3cfe8 ARTEMIS-4279 Improving BAD JDBC Configuration Test
e959e3cfe8 is described below
commit e959e3cfe84ea2780a9f4cbc58f0f36919e8b06d
Author: Clebert Suconic <[email protected]>
AuthorDate: Wed May 17 09:56:52 2023 -0400
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);
}
}