From f380324ca3308ffde6a36b6681386f429ddd1134 Mon Sep 17 00:00:00 2001 From: Clebert Suconic Date: Wed, 2 Jun 2021 19:53:26 -0400 Subject: [PATCH] NO-JIRA fixing intermittent failure with a Wait call --- .../tests/integration/client/TransactionalSendTest.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/TransactionalSendTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/TransactionalSendTest.java index b72e7a9399..18d0d15393 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/TransactionalSendTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/TransactionalSendTest.java @@ -25,6 +25,7 @@ import org.apache.activemq.artemis.api.core.client.ServerLocator; import org.apache.activemq.artemis.core.server.ActiveMQServer; import org.apache.activemq.artemis.core.server.Queue; import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; +import org.apache.activemq.artemis.tests.util.Wait; import org.junit.Assert; import org.junit.Before; import org.junit.Test; @@ -68,9 +69,9 @@ public class TransactionalSendTest extends ActiveMQTestBase { for (int i = 0; i < numMessages; i++) { cp.send(session.createMessage(false)); } - Assert.assertEquals(numMessages, getMessageCount(q)); + Wait.assertEquals(numMessages, q::getMessageCount); session.commit(); - Assert.assertEquals(numMessages * 2, getMessageCount(q)); + Wait.assertEquals(numMessages * 2, q::getMessageCount); session.close(); } @@ -94,9 +95,9 @@ public class TransactionalSendTest extends ActiveMQTestBase { for (int i = 0; i < numMessages; i++) { cp.send(session.createMessage(false)); } - Assert.assertEquals(0, getMessageCount(q)); + Wait.assertEquals(0, q::getMessageCount); session.commit(); - Assert.assertEquals(numMessages, getMessageCount(q)); + Wait.assertEquals(numMessages, q::getMessageCount); session.close(); }