From 5c2f79ed45993c843f6449cb6e649d157c64208b Mon Sep 17 00:00:00 2001 From: Jiri Danek Date: Tue, 7 Aug 2018 16:56:20 +0200 Subject: [PATCH] NO-JIRA fix flaky test QueueControlTest#testListMessagesWithEmptyFilter The below error is prevented by using Wait.assertEquals where Assert.assertEquals was used previously. java.lang.AssertionError: Expected :2 Actual :1 [...] at org.apache.activemq.artemis.tests.integration.management.QueueControlTest.testListMessagesWithEmptyFilter(QueueControlTest.java:827) --- .../tests/integration/management/QueueControlTest.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/QueueControlTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/QueueControlTest.java index da8ea17df0..8eb6e03d60 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/QueueControlTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/QueueControlTest.java @@ -823,13 +823,11 @@ public class QueueControlTest extends ManagementTestBase { producer.send(session.createMessage(durable)); producer.send(session.createMessage(durable)); - Map[] messages = queueControl.listMessages(""); - Assert.assertEquals(2, messages.length); + Wait.assertEquals(2, () -> queueControl.listMessages("").length); consumeMessages(2, session, queue); - messages = queueControl.listMessages(""); - Assert.assertEquals(0, messages.length); + Wait.assertEquals(0, () -> queueControl.listMessages("").length); session.deleteQueue(queue); }