Browse Source

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.
pull/24831/head
Sam Brannen 6 years ago
parent
commit
9bd74c270f
  1. 14
      spring-context/src/test/java/org/springframework/jmx/access/MBeanClientInterceptorTests.java

14
spring-context/src/test/java/org/springframework/jmx/access/MBeanClientInterceptorTests.java

@ -24,7 +24,6 @@ import java.lang.reflect.Method; @@ -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; @@ -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 { @@ -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 {

Loading…
Cancel
Save