From 9bd74c270f880b8c2d98f13eefda0fe98f372029 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Tue, 31 Mar 2020 18:55:54 +0200 Subject: [PATCH] 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. --- .../jmx/access/MBeanClientInterceptorTests.java | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/spring-context/src/test/java/org/springframework/jmx/access/MBeanClientInterceptorTests.java b/spring-context/src/test/java/org/springframework/jmx/access/MBeanClientInterceptorTests.java index 7b2a826e38d..beafff465e1 100644 --- a/spring-context/src/test/java/org/springframework/jmx/access/MBeanClientInterceptorTests.java +++ b/spring-context/src/test/java/org/springframework/jmx/access/MBeanClientInterceptorTests.java @@ -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 {