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 40e9d4ebf7 NO-JIRA Trying to fix intermittent failure on 
ShutdownOnCriticalIOErrorMoveNextTest
40e9d4ebf7 is described below

commit 40e9d4ebf7fe26dcb019156b8662493bea1fc57b
Author: Clebert Suconic <[email protected]>
AuthorDate: Mon Mar 27 15:11:31 2023 -0400

    NO-JIRA Trying to fix intermittent failure on 
ShutdownOnCriticalIOErrorMoveNextTest
---
 .../ShutdownOnCriticalIOErrorMoveNextTest.java     | 32 +++++++++-------------
 1 file changed, 13 insertions(+), 19 deletions(-)

diff --git 
a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/critical/ShutdownOnCriticalIOErrorMoveNextTest.java
 
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/critical/ShutdownOnCriticalIOErrorMoveNextTest.java
index 49daeff089..26e93b9b73 100644
--- 
a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/critical/ShutdownOnCriticalIOErrorMoveNextTest.java
+++ 
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/critical/ShutdownOnCriticalIOErrorMoveNextTest.java
@@ -50,31 +50,25 @@ public class ShutdownOnCriticalIOErrorMoveNextTest extends 
ActiveMQTestBase {
       deleteDirectory(new File("./target/server"));
       ActiveMQServer server = createServer("./target/server");
 
-      try {
-         server.start();
+      server.start();
 
-         ConnectionFactory factory = new ActiveMQConnectionFactory();
-         Connection connection = factory.createConnection();
+      ConnectionFactory factory = new ActiveMQConnectionFactory();
+      Connection connection = factory.createConnection();
 
-         Session session = connection.createSession();
+      Session session = connection.createSession();
 
-         MessageProducer producer = 
session.createProducer(session.createQueue("queue"));
+      MessageProducer producer = 
session.createProducer(session.createQueue("queue"));
 
-         try {
-            for (int i = 0; i < 500; i++) {
-               producer.send(session.createTextMessage("text"));
-            }
-         } catch (JMSException expected) {
+      try {
+         for (int i = 0; i < 500; i++) {
+            producer.send(session.createTextMessage("text"));
          }
+      } catch (JMSException expected) {
+      }
 
-         Wait.waitFor(() -> !server.isStarted());
-
-         Assert.assertFalse(server.isStarted());
-
-      } finally {
-         server.stop();
+      Wait.waitFor(() -> !server.isStarted());
 
-      }
+      Assert.assertFalse(server.isStarted());
 
    }
 
@@ -121,7 +115,7 @@ public class ShutdownOnCriticalIOErrorMoveNextTest extends 
ActiveMQTestBase {
 
       };
 
-      return server;
+      return addServer(server);
    }
 
    Configuration createConfig(String folder) throws Exception {

Reply via email to