prevent test failing on slower machines

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@900363 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Bosanac Dejan 2010-01-18 12:19:54 +00:00
parent 7ceb4cbc43
commit 2ac5e7aa3e
1 changed files with 7 additions and 2 deletions

View File

@ -91,6 +91,7 @@ public class DiscoveryNetworkReconnectTest {
configure(brokerA); configure(brokerA);
brokerA.addConnector("tcp://localhost:0"); brokerA.addConnector("tcp://localhost:0");
brokerA.start(); brokerA.start();
brokerA.waitUntilStarted();
proxy = new SocketProxy(brokerA.getTransportConnectors().get(0).getConnectUri()); proxy = new SocketProxy(brokerA.getTransportConnectors().get(0).getConnectUri());
managementContext = context.mock(ManagementContext.class); managementContext = context.mock(ManagementContext.class);
@ -146,7 +147,9 @@ public class DiscoveryNetworkReconnectTest {
@After @After
public void tearDown() throws Exception { public void tearDown() throws Exception {
brokerA.stop(); brokerA.stop();
brokerA.waitUntilStopped();
brokerB.stop(); brokerB.stop();
brokerB.waitUntilStopped();
proxy.close(); proxy.close();
} }
@ -165,6 +168,7 @@ public class DiscoveryNetworkReconnectTest {
brokerB.addNetworkConnector(discoveryAddress + "&wireFormat.maxInactivityDuration=1000&wireFormat.maxInactivityDurationInitalDelay=1000"); brokerB.addNetworkConnector(discoveryAddress + "&wireFormat.maxInactivityDuration=1000&wireFormat.maxInactivityDurationInitalDelay=1000");
brokerB.start(); brokerB.start();
brokerB.waitUntilStarted();
doReconnect(); doReconnect();
} }
@ -175,6 +179,7 @@ public class DiscoveryNetworkReconnectTest {
brokerB.addNetworkConnector("simple://(" + proxy.getUrl() brokerB.addNetworkConnector("simple://(" + proxy.getUrl()
+ ")?useExponentialBackOff=false&initialReconnectDelay=500&wireFormat.maxInactivityDuration=1000&wireFormat.maxInactivityDurationInitalDelay=1000"); + ")?useExponentialBackOff=false&initialReconnectDelay=500&wireFormat.maxInactivityDuration=1000&wireFormat.maxInactivityDurationInitalDelay=1000");
brokerB.start(); brokerB.start();
brokerB.waitUntilStarted();
doReconnect(); doReconnect();
} }
@ -189,7 +194,7 @@ public class DiscoveryNetworkReconnectTest {
})); }));
// wait for network connector // wait for network connector
assertTrue("network connector mbean registered within 1 minute", mbeanRegistered.tryAcquire(60, TimeUnit.SECONDS)); assertTrue("network connector mbean registered within 2 minute", mbeanRegistered.tryAcquire(120, TimeUnit.SECONDS));
// force an inactivity timeout via the proxy // force an inactivity timeout via the proxy
proxy.pause(); proxy.pause();