This closes #84 - fixing races on tests

This commit is contained in:
Clebert Suconic 2015-01-28 14:10:22 -05:00
commit c6a444fe5c
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));
long timeout = System.currentTimeMillis() + 1000;
while (timeout > System.currentTimeMillis() && !((ActiveMQMessageConsumer)cons).isClosed())
{
Thread.sleep(1);
}
Assert.assertTrue(((ActiveMQMessageConsumer)cons).isClosed());
try
{
cons.receive(5000);