From 5c2144b7826c25e8510f870b588e873685291d74 Mon Sep 17 00:00:00 2001 From: Clebert Suconic Date: Tue, 27 Jun 2017 12:48:33 -0400 Subject: [PATCH] ARTEMIS-1256 PagingOMETest.testPageCleanup fails Using a Wait condition. This closes #1370 --- .../activemq/artemis/tests/extras/byteman/PagingOMETest.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/PagingOMETest.java b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/PagingOMETest.java index cdf1c56488..7ef4e9f682 100644 --- a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/PagingOMETest.java +++ b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/PagingOMETest.java @@ -33,6 +33,7 @@ import org.apache.activemq.artemis.core.server.ActiveMQServer; import org.apache.activemq.artemis.core.server.Queue; import org.apache.activemq.artemis.core.settings.impl.AddressSettings; import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; +import org.apache.activemq.artemis.tests.util.Wait; import org.jboss.byteman.contrib.bmunit.BMRule; import org.jboss.byteman.contrib.bmunit.BMRules; import org.jboss.byteman.contrib.bmunit.BMUnitRunner; @@ -145,7 +146,7 @@ public class PagingOMETest extends ActiveMQTestBase { session.start(); - assertEquals(numberOfMessages, queue.getMessageCount()); + Assert.assertTrue(Wait.waitFor(() -> numberOfMessages == queue.getMessageCount())); // The consumer has to be created after the queue.getMessageCount assertion // otherwise delivery could alter the messagecount and give us a false failure