Added timeout because of tests failing intermittently

This commit is contained in:
Kevin Earls 2014-01-03 15:16:11 +01:00
parent 96bdda716a
commit 6509b1f811
1 changed files with 5 additions and 1 deletions

View File

@ -194,11 +194,15 @@ public abstract class DeadLetterTestSupport extends TestSupport {
}
private void validateConsumerPrefetch(String destination, long expectedCount) {
try {
Thread.sleep(100);
} catch (InterruptedException e) {
}
RegionBroker regionBroker = (RegionBroker) broker.getRegionBroker();
for (org.apache.activemq.broker.region.Destination dest : regionBroker.getQueueRegion().getDestinationMap().values()) {
if (dest.getName().equals(destination)) {
DestinationStatistics stats = dest.getDestinationStatistics();
LOG.info("inflight for : " + dest.getName() + ": " + stats.getInflight().getCount());
LOG.info(">>>> inflight for : " + dest.getName() + ": " + stats.getInflight().getCount());
assertEquals("inflight for: " + dest.getName() + ": " + stats.getInflight().getCount() + " matches",
expectedCount, stats.getInflight().getCount());
}