diff --git a/apm-agent-core/src/test/java/co/elastic/apm/agent/bci/InstrumentationTest.java b/apm-agent-core/src/test/java/co/elastic/apm/agent/bci/InstrumentationTest.java index 063e38e283..0f3471a712 100644 --- a/apm-agent-core/src/test/java/co/elastic/apm/agent/bci/InstrumentationTest.java +++ b/apm-agent-core/src/test/java/co/elastic/apm/agent/bci/InstrumentationTest.java @@ -45,6 +45,7 @@ import org.apache.commons.pool2.impl.CallStackUtils; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.condition.DisabledOnJre; import org.junit.jupiter.api.condition.JRE; @@ -421,8 +422,8 @@ void testPluginClassLoaderGCdAfterUndoingInstrumentation() { await().untilAsserted(() -> assertThat(pluginClassLoader.get()).isNull()); } - //this is failing from unspecified - likely metaspace specific GC not happening - in CI -// @Test + @Disabled("this is failing from unspecified - likely metaspace specific GC not happening - in CI") + @Test void testNoClassLoaderLeakWhenInstrumentedApplicationIsUndeployed() throws Exception { ElasticApmAgent.initInstrumentation(tracer, ByteBuddyAgent.install(), @@ -442,10 +443,7 @@ void testNoClassLoaderLeakWhenInstrumentedApplicationIsUndeployed() throws Excep applicationCL = null; instrumentedClass = null; - long start = System.currentTimeMillis(); - while(System.currentTimeMillis()-start < 10_000) { - - } + System.gc(); System.gc(); await().untilAsserted(() -> assertThat(applicationCLRef.get()).isNull()); }