Skip to content

Commit

Permalink
NO-JIRA fix flaky test QueueControlTest#testListMessagesWithEmptyFilter
Browse files Browse the repository at this point in the history
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)

(cherry picked from commit 5c2f79e)
  • Loading branch information
jiridanek authored and clebertsuconic committed Aug 8, 2018
1 parent 6eaa3ab commit 96421f6
Showing 1 changed file with 2 additions and 4 deletions.
Expand Up @@ -823,13 +823,11 @@ public void testListMessagesWithEmptyFilter() throws Exception {
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);
}
Expand Down

0 comments on commit 96421f6

Please sign in to comment.