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)
This commit is contained in:
Jiri Danek 2018-08-07 16:56:20 +02:00 committed by Clebert Suconic
parent 1b15f95554
commit 5c2f79ed45
1 changed files with 2 additions and 4 deletions

View File

@ -823,13 +823,11 @@ public class QueueControlTest extends ManagementTestBase {
producer.send(session.createMessage(durable));
producer.send(session.createMessage(durable));
Map<String, Object>[] 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);
}