diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/server/management/JMSServerControlTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/server/management/JMSServerControlTest.java index d36492f910..0dd1900084 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/server/management/JMSServerControlTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/jms/server/management/JMSServerControlTest.java @@ -562,6 +562,14 @@ public class JMSServerControlTest extends ManagementTestBase Assert.assertNull(fakeJMSStorageManager.destinationMap.get(queueName)); + long timeout = System.currentTimeMillis() + 1000; + while (timeout > System.currentTimeMillis() && !((ActiveMQMessageConsumer)cons).isClosed()) + { + Thread.sleep(1); + } + + Assert.assertTrue(((ActiveMQMessageConsumer)cons).isClosed()); + try { cons.receive(5000);