NO-JIRA fix flaky test QueueControlTest#testListMessagesWithNullFilter

The below error is prevented by using Wait.assertEquals
where Assert.assertEquals was used previously.

    java.lang.AssertionError:
    Expected :2
    Actual   :1
        [...]
    	at org.junit.Assert.assertEquals(Assert.java:542)
    	at org.apache.activemq.artemis.tests.integration.management.QueueControlTest.testListMessagesWithNullFilter(QueueControlTest.java:804)
This commit is contained in:
Jiri Danek 2018-08-07 16:59:30 +02:00 committed by Clebert Suconic
parent 5c2f79ed45
commit fbb622ae69
1 changed files with 2 additions and 4 deletions

View File

@ -800,13 +800,11 @@ public class QueueControlTest extends ManagementTestBase {
producer.send(session.createMessage(durable)); producer.send(session.createMessage(durable));
producer.send(session.createMessage(durable)); producer.send(session.createMessage(durable));
Map<String, Object>[] messages = queueControl.listMessages(null); Wait.assertEquals(2, () -> queueControl.listMessages(null).length);
Assert.assertEquals(2, messages.length);
consumeMessages(2, session, queue); consumeMessages(2, session, queue);
messages = queueControl.listMessages(null); Wait.assertEquals(0, () -> queueControl.listMessages(null).length);
Assert.assertEquals(0, messages.length);
session.deleteQueue(queue); session.deleteQueue(queue);
} }