Fix test race condition
This commit is contained in:
parent
3869d49353
commit
4bece40706
|
@ -39,12 +39,15 @@ import org.apache.activemq.artemis.api.core.client.ClientSessionFactory;
|
|||
import org.apache.activemq.artemis.api.core.client.ServerLocator;
|
||||
import org.apache.activemq.artemis.api.core.management.ResourceNames;
|
||||
import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
|
||||
import org.apache.activemq.artemis.core.postoffice.impl.LocalQueueBinding;
|
||||
import org.apache.activemq.artemis.core.protocol.stomp.Stomp;
|
||||
import org.apache.activemq.artemis.core.server.Queue;
|
||||
import org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl;
|
||||
import org.apache.activemq.artemis.logs.AssertionLoggerHandler;
|
||||
import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
|
||||
import org.apache.activemq.artemis.tests.integration.mqtt.imported.FuseMQTTClientProvider;
|
||||
import org.apache.activemq.artemis.tests.integration.mqtt.imported.MQTTClientProvider;
|
||||
import org.apache.activemq.artemis.tests.util.Wait;
|
||||
import org.apache.activemq.artemis.utils.RandomUtil;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
@ -1358,6 +1361,18 @@ public class StompTest extends StompTestBase {
|
|||
|
||||
assertNotNull(server.getActiveMQServer().getPostOffice().getBinding(new SimpleString(ResourceNames.JMS_QUEUE + nonExistentQueue)));
|
||||
|
||||
final Queue subscription = ((LocalQueueBinding)server.getActiveMQServer().getPostOffice().getBinding(new SimpleString(ResourceNames.JMS_QUEUE + nonExistentQueue))).getQueue();
|
||||
|
||||
assertTrue(Wait.waitFor(new Wait.Condition() {
|
||||
@Override
|
||||
public boolean isSatisfied() throws Exception {
|
||||
if (subscription.getMessageCount() == 0)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
}, 1000, 50));
|
||||
|
||||
frame = "UNSUBSCRIBE\n" + "destination:" +
|
||||
getQueuePrefix() +
|
||||
nonExistentQueue +
|
||||
|
|
Loading…
Reference in New Issue