NO-JIRA fix flaky tests QueueControlTest#testResetMessagesExpired

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

    java.lang.AssertionError:
    Expected :1
    Actual   :0
    [...]
    	at org.junit.Assert.assertEquals(Assert.java:542)
	    at org.apache.activemq.artemis.tests.integration.management.QueueControlTest.testResetMessagesExpired(QueueControlTest.java:2370)
This commit is contained in:
Jiri Danek 2018-08-07 20:16:18 +02:00 committed by Clebert Suconic
parent c6521e0700
commit fed0426ff3
1 changed files with 3 additions and 2 deletions

View File

@ -2366,8 +2366,9 @@ public class QueueControlTest extends ManagementTestBase {
producer.send(message);
// the message IDs are set on the server
Map<String, Object>[] messages = queueControl.listMessages(null);
Assert.assertEquals(1, messages.length);
Map<String, Object>[] messages;
Wait.assertEquals(1, () -> queueControl.listMessages(null).length);
messages = queueControl.listMessages(null);
long messageID = (Long) messages[0].get("messageID");
queueControl.expireMessage(messageID);