Skip to content
Permalink
Browse files
NO-JIRA Improving PagingFailoverTest with Wait.assertFalse
  • Loading branch information
clebertsuconic committed May 23, 2022
1 parent f9ec449 commit b3640c9ae816c1947aa7308136fad0455c90f02f
Showing 1 changed file with 4 additions and 8 deletions.
@@ -34,6 +34,7 @@
import org.apache.activemq.artemis.tests.integration.cluster.util.SameProcessActiveMQServer;
import org.apache.activemq.artemis.tests.integration.cluster.util.TestableServer;
import org.apache.activemq.artemis.tests.util.TransportConfigurationUtils;
import org.apache.activemq.artemis.tests.util.Wait;
import org.apache.activemq.artemis.utils.RetryRule;
import org.junit.Assert;
import org.junit.Before;
@@ -189,15 +190,10 @@ public void testExpireMessage() throws Exception {

Queue queue = backupServer.getServer().locateQueue(ADDRESS);

long timeout = System.currentTimeMillis() + 6000;

while (timeout > System.currentTimeMillis() && queue.getPageSubscription().isPaging()) {
Thread.sleep(100);
// Simulating what would happen on expire
Wait.assertFalse( () -> {
queue.expireReferences();
}

Assert.assertFalse(queue.getPageSubscription().isPaging());
return queue.getPageSubscription().isPaging();
});

}

0 comments on commit b3640c9

Please sign in to comment.