https://issues.apache.org/jira/browse/AMQ-5086 - init of broker got dropped after mutex wait - testWaitFor was failing

This commit is contained in:
gtully 2014-07-14 16:49:03 +01:00
parent ee08fc1e24
commit a9b8d98ed7
2 changed files with 3 additions and 2 deletions

View File

@ -196,6 +196,7 @@ public class VMTransportFactory extends TransportFactory {
try {
LOG.debug("waiting for broker named: " + brokerName + " to enter registry");
registry.getRegistryMutext().wait(timeout);
broker = registry.lookup(brokerName);
} catch (InterruptedException ignored) {
}
}

View File

@ -67,7 +67,7 @@ public class VMTransportWaitForTest {
// spawn a thread that will wait for an embedded broker to start via
// vm://..
Thread t = new Thread() {
Thread t = new Thread("ClientConnectionThread") {
@Override
public void run() {
try {
@ -89,7 +89,7 @@ public class VMTransportWaitForTest {
BrokerService broker = new BrokerService();
broker.setPersistent(false);
broker.start();
assertTrue("has got connection", gotConnection.await(400, TimeUnit.MILLISECONDS));
assertTrue("has got connection", gotConnection.await(5, TimeUnit.SECONDS));
broker.stop();
}