fix race in test

This commit is contained in:
jbertram 2015-01-27 13:29:05 -06:00
parent 90b8b35b54
commit d895988faf
1 changed files with 8 additions and 0 deletions

View File

@ -562,6 +562,14 @@ public class JMSServerControlTest extends ManagementTestBase
Assert.assertNull(fakeJMSStorageManager.destinationMap.get(queueName)); 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 try
{ {
cons.receive(5000); cons.receive(5000);