You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by cl...@apache.org on 2024/05/28 21:26:21 UTC

(activemq-artemis) branch main updated: NO-JIRA fix intermittent failure on LargeMessageRetentionTest

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 58fc7cbea1 NO-JIRA fix intermittent failure on LargeMessageRetentionTest
58fc7cbea1 is described below

commit 58fc7cbea17319c05da10b1de5483eb7dff0ab02
Author: Clebert Suconic <cl...@apache.org>
AuthorDate: Tue May 28 17:25:52 2024 -0400

    NO-JIRA fix intermittent failure on LargeMessageRetentionTest
---
 .../tests/soak/retention/LargeMessageRetentionTest.java       | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/retention/LargeMessageRetentionTest.java b/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/retention/LargeMessageRetentionTest.java
index cf02d9214b..d1e73118e6 100644
--- a/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/retention/LargeMessageRetentionTest.java
+++ b/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/retention/LargeMessageRetentionTest.java
@@ -28,6 +28,7 @@ import javax.jms.TextMessage;
 import java.io.File;
 import java.lang.invoke.MethodHandles;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
@@ -212,15 +213,23 @@ public class LargeMessageRetentionTest extends SoakTestBase {
          SimpleManagement simpleManagement = new SimpleManagement("tcp://localhost:61616", null, null);
          Wait.assertEquals(10, () -> simpleManagement.getMessageCountOnQueue(queueName), 5000);
 
+         HashSet<Integer> receivedMessages = new HashSet<>();
+
          for (int i = 0; i < 10; i++) {
             TextMessage message = (TextMessage) consumer.receive(300_000);
             Assert.assertNotNull(message);
             logger.info("Received replay message {}", i);
             Assert.assertEquals(0, message.getIntProperty("producerI"));
-            Assert.assertEquals(i, message.getIntProperty("messageI"));
+            receivedMessages.add(message.getIntProperty("messageI"));
             Assert.assertEquals(bufferStr, message.getText());
          }
          Assert.assertNull(consumer.receiveNoWait());
+
+         Assert.assertEquals(10, receivedMessages.size());
+         for (int i = 0; i < 10; i++) {
+            Assert.assertTrue(receivedMessages.contains(i));
+         }
+
       }
    }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@activemq.apache.org
For additional commands, e-mail: commits-help@activemq.apache.org
For further information, visit: https://activemq.apache.org/contact