ARTEMIS-1140: Trivial test fix

(cherry picked from commit 0146109d6a)
This commit is contained in:
Clebert Suconic 2017-05-03 16:12:01 -04:00
parent 534fd8093d
commit 468b8a954b
1 changed files with 9 additions and 1 deletions

View File

@ -371,7 +371,15 @@ public abstract class ActiveMQServerTestCase {
if (binding != null && binding instanceof LocalQueueBinding) {
((LocalQueueBinding) binding).getQueue().flushExecutor();
}
Long messageCount = ActiveMQServerTestCase.servers.get(0).getMessageCountForQueue(queueName);
Long messageCount = null;
for (int i = 0; i < 10; i++) {
messageCount = servers.get(0).getMessageCountForQueue(queueName);
if (messageCount.longValue() == expected) {
break;
} else {
Thread.sleep(100);
}
}
ProxyAssertSupport.assertEquals(expected, messageCount.intValue());
return expected == messageCount.intValue();