From a1c6a5c3b68ad81ee7c551ec1f9ee19b1ecaa40a Mon Sep 17 00:00:00 2001 From: Clebert Suconic Date: Wed, 17 Apr 2024 17:43:41 -0400 Subject: [PATCH] NO-JIRA making test more reliable --- .../tests/soak/retention/LargeMessageRetentionTest.java | 4 ++++ 1 file changed, 4 insertions(+) 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 9d525f8456..cf02d9214b 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 @@ -38,9 +38,11 @@ import java.util.concurrent.atomic.AtomicInteger; import org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration; import org.apache.activemq.artemis.api.core.management.ActiveMQServerControl; import org.apache.activemq.artemis.api.core.management.ObjectNameBuilder; +import org.apache.activemq.artemis.api.core.management.SimpleManagement; import org.apache.activemq.artemis.tests.soak.SoakTestBase; import org.apache.activemq.artemis.tests.util.CFUtil; import org.apache.activemq.artemis.utils.RandomUtil; +import org.apache.activemq.artemis.utils.Wait; import org.apache.activemq.artemis.utils.cli.helper.HelperCreate; import org.junit.Assert; import org.junit.Before; @@ -207,6 +209,8 @@ public class LargeMessageRetentionTest extends SoakTestBase { Assert.assertNull(consumer.receiveNoWait()); serverControl.replay(queueName, queueName, "producerI=0 AND messageI>=0 AND messageI<10"); + SimpleManagement simpleManagement = new SimpleManagement("tcp://localhost:61616", null, null); + Wait.assertEquals(10, () -> simpleManagement.getMessageCountOnQueue(queueName), 5000); for (int i = 0; i < 10; i++) { TextMessage message = (TextMessage) consumer.receive(300_000);