Remove flaky check in MBeanClientInterceptorTests

Prior to this commit, the testTestLazyConnectionToRemote() method in
MBeanClientInterceptorTests expected an exception to be thrown while
attempting to access the state of a proxied MBean after the MBeanServer
had been shutdown; however, the test occasionally failed if the server
had not been properly shutdown.

Since an attempt to wait on the server to shutdown proved not to be
consistently helpful in this scenario, we are entirely removing this
check from the test.
This commit is contained in:
Sam Brannen
2020-03-31 18:55:54 +02:00
parent 89d282125a
commit 9bd74c270f

View File

@@ -24,7 +24,6 @@ import java.lang.reflect.Method;
import java.net.BindException;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import javax.management.Descriptor;
import javax.management.MBeanServerConnection;
@@ -32,13 +31,11 @@ import javax.management.remote.JMXConnectorServer;
import javax.management.remote.JMXConnectorServerFactory;
import javax.management.remote.JMXServiceURL;
import org.awaitility.Awaitility;
import org.junit.jupiter.api.Test;
import org.springframework.aop.framework.ProxyFactory;
import org.springframework.jmx.AbstractMBeanServerTests;
import org.springframework.jmx.IJmxTestBean;
import org.springframework.jmx.JmxException;
import org.springframework.jmx.JmxTestBean;
import org.springframework.jmx.export.MBeanExporter;
import org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler;
@@ -218,17 +215,6 @@ class MBeanClientInterceptorTests extends AbstractMBeanServerTests {
finally {
connector.stop();
}
try {
Awaitility.await()
.atMost(500, TimeUnit.MILLISECONDS)
.pollInterval(10, TimeUnit.MILLISECONDS)
.until(() -> !connector.isActive());
bean.getName();
}
catch (JmxException ex) {
// expected
}
}
public void testMXBeanAttributeAccess() throws Exception {