ARTEMIS-1256 PagingOMETest.testPageCleanup fails

Using a Wait condition.

This closes #1370

(cherry picked from commit 5c2144b7826c25e8510f870b588e873685291d74)
This commit is contained in:
Clebert Suconic 2017-06-27 12:48:33 -04:00
parent bc815004d2
commit c5e88c5e2d

View File

@ -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