resolve intermittent failure of DiscoveryNetworkReconnectTest due to network timing issues

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@833435 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Gary Tully 2009-11-06 15:14:05 +00:00
parent b3873fb3e4
commit 814c49f058
2 changed files with 6 additions and 4 deletions

View File

@ -47,7 +47,7 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
/** /**
* A Flow provides different dispatch policies within the NMR * An abstraction over JMX mbean registration
* *
* @org.apache.xbean.XBean * @org.apache.xbean.XBean
* @version $Revision$ * @version $Revision$
@ -91,14 +91,13 @@ public class ManagementContext implements Service {
try { try {
getMBeanServer().invoke(namingServiceObjectName, "start", null, null); getMBeanServer().invoke(namingServiceObjectName, "start", null, null);
} catch (Throwable ignore) { } catch (Throwable ignore) {
LOG.debug("ignored error on start invocation", ignore);
} }
Thread t = new Thread("JMX connector") { Thread t = new Thread("JMX connector") {
public void run() { public void run() {
try { try {
JMXConnectorServer server = connectorServer; JMXConnectorServer server = connectorServer;
if (started.get() && server != null) { if (started.get() && server != null) {
LOG.debug("Starting JMX JMXConnectorServer..."); LOG.debug("Starting JMXConnectorServer...");
server.start(); server.start();
LOG.info("JMX consoles can connect to " + server.getAddress()); LOG.info("JMX consoles can connect to " + server.getAddress());
} }

View File

@ -195,8 +195,11 @@ public class DiscoveryNetworkReconnectTest {
// wait for the inactivity timeout and network shutdown // wait for the inactivity timeout and network shutdown
assertTrue("network connector mbean unregistered within 1 minute", mbeanUnregistered.tryAcquire(60, TimeUnit.SECONDS)); assertTrue("network connector mbean unregistered within 1 minute", mbeanUnregistered.tryAcquire(60, TimeUnit.SECONDS));
// whack all connections
proxy.close();
// let a reconnect succeed // let a reconnect succeed
proxy.goOn(); proxy.reopen();
} }
} }
} }