From d895988faf267aa39fe5b37312bd2cbdaa8168f3 Mon Sep 17 00:00:00 2001 From: jbertram Date: Tue, 27 Jan 2015 13:29:05 -0600 Subject: [PATCH] fix race in test --- .../jms/server/management/JMSServerControlTest.java | 8 ++++++++ 1 file changed, 8 insertions(+) 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);