Test can hang if the async event isn't received, add a timeout in the test loop's wait call to prevent this.

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1311402 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Timothy A. Bish 2012-04-09 19:58:13 +00:00
parent 681c1abf37
commit 934eaf9923
1 changed files with 1 additions and 1 deletions

View File

@ -70,7 +70,7 @@ public class OnePrefetchAsyncConsumerTest extends EmbeddedBrokerTestSupport {
long done = System.currentTimeMillis() + getMaxTestTime(); long done = System.currentTimeMillis() + getMaxTestTime();
synchronized (testMutex) { synchronized (testMutex) {
while (!testMutex.testCompleted && System.currentTimeMillis() < done) { while (!testMutex.testCompleted && System.currentTimeMillis() < done) {
testMutex.wait(); testMutex.wait(TimeUnit.SECONDS.toMillis(5));
} }
} }