From 66040b009c5f3bedd43395ac7fb0e9ebda790e0f Mon Sep 17 00:00:00 2001 From: Clebert Suconic Date: Tue, 23 Feb 2021 13:59:24 -0500 Subject: [PATCH] ARTEMIS-3135 Fixing intermittent test failure --- .../artemis/tests/integration/amqp/JMXManagementTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMXManagementTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMXManagementTest.java index fd6a781afd..128636a3a0 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMXManagementTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMXManagementTest.java @@ -148,13 +148,13 @@ public class JMXManagementTest extends JMSClientTestSupport { SimpleString queue = new SimpleString(getQueueName()); QueueControl queueControl = createManagementControl(queue, queue); - Assert.assertEquals(2, queueControl.getMessageCount()); + Wait.assertEquals(2, queueControl::getMessageCount); JsonArray array = JsonUtil.readJsonArray(queueControl.getFirstMessageAsJSON()); JsonObject object = (JsonObject) array.get(0); queueControl.removeMessage(object.getJsonNumber("messageID").longValue()); - Wait.assertEquals(1L, queueControl::getMessageCount); + Wait.assertEquals(1, queueControl::getMessageCount); Map[] messages = queueControl.listMessages(""); Assert.assertEquals(1, messages.length);