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 ae92b714e3 NO-JIRA Test improvements
ae92b714e3 is described below

commit ae92b714e3b4de5f7e20b692e42c623b58ab5718
Author: Clebert Suconic <[email protected]>
AuthorDate: Fri May 31 21:59:28 2024 -0400

    NO-JIRA Test improvements
---
 .../soak/replicationflow/SoakReplicatedPagingTest.java     | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git 
a/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/replicationflow/SoakReplicatedPagingTest.java
 
b/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/replicationflow/SoakReplicatedPagingTest.java
index 0758a5425e..0d107dad3c 100644
--- 
a/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/replicationflow/SoakReplicatedPagingTest.java
+++ 
b/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/replicationflow/SoakReplicatedPagingTest.java
@@ -56,6 +56,7 @@ import java.util.concurrent.atomic.AtomicInteger;
 import org.apache.activemq.artemis.tests.soak.SoakTestBase;
 import org.apache.activemq.artemis.utils.ExecuteUtil;
 import org.apache.activemq.artemis.utils.SpawnedVMSupport;
+import org.apache.activemq.artemis.utils.Wait;
 import org.apache.activemq.artemis.utils.cli.helper.HelperCreate;
 import org.apache.qpid.jms.JmsConnectionFactory;
 import org.fusesource.mqtt.client.BlockingConnection;
@@ -73,6 +74,8 @@ import org.slf4j.LoggerFactory;
 @RunWith(Parameterized.class)
 public class SoakReplicatedPagingTest extends SoakTestBase {
 
+   public static int OK = 1;
+
    private static final Logger logger = 
LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
 
    public static final int LAG_CONSUMER_TIME = 1000;
@@ -224,7 +227,12 @@ public class SoakReplicatedPagingTest extends SoakTestBase 
{
          logger.debug("Awaiting timeout...");
          Thread.sleep(time);
 
-         int exitStatus = consumed.get() > 0 ? 1 : -3;
+         if (consumed.get() == 0) {
+            System.out.println("Retrying to wait consumers...");
+            Wait.assertTrue(() -> consumed.get() > 0, 15_000, 100);
+         }
+
+         int exitStatus = consumed.get() > 0 ? OK : -3;
          logger.debug("Exiting with the status: {}", exitStatus);
 
          exit(exitStatus, "Consumed " + consumed.get() + " messages");
@@ -236,7 +244,7 @@ public class SoakReplicatedPagingTest extends SoakTestBase {
    }
 
    public static void exit(int code, String message) {
-      System.out.println("Exit code:: " + message);
+      System.out.println("Exit code:: " + code + "::" + message);
       System.exit(code);
    }
 
@@ -259,7 +267,7 @@ public class SoakReplicatedPagingTest extends SoakTestBase {
          if (result <= 0) {
             jstack();
          }
-         Assert.assertEquals(0, result);
+         Assert.assertEquals(OK, result);
       }
    }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact


Reply via email to