NO-JIRA Improving PagingFailoverTest with Wait.assertFalse
This commit is contained in:
parent
f9ec449ac4
commit
b3640c9ae8
|
@ -34,6 +34,7 @@ import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
|
||||||
import org.apache.activemq.artemis.tests.integration.cluster.util.SameProcessActiveMQServer;
|
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.integration.cluster.util.TestableServer;
|
||||||
import org.apache.activemq.artemis.tests.util.TransportConfigurationUtils;
|
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.apache.activemq.artemis.utils.RetryRule;
|
||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
|
@ -189,15 +190,10 @@ public class PagingFailoverTest extends FailoverTestBase {
|
||||||
|
|
||||||
Queue queue = backupServer.getServer().locateQueue(ADDRESS);
|
Queue queue = backupServer.getServer().locateQueue(ADDRESS);
|
||||||
|
|
||||||
long timeout = System.currentTimeMillis() + 6000;
|
Wait.assertFalse( () -> {
|
||||||
|
|
||||||
while (timeout > System.currentTimeMillis() && queue.getPageSubscription().isPaging()) {
|
|
||||||
Thread.sleep(100);
|
|
||||||
// Simulating what would happen on expire
|
|
||||||
queue.expireReferences();
|
queue.expireReferences();
|
||||||
}
|
return queue.getPageSubscription().isPaging();
|
||||||
|
});
|
||||||
Assert.assertFalse(queue.getPageSubscription().isPaging());
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue