From d21bf45b171c107123ad99920a733e4d9f6ae65e Mon Sep 17 00:00:00 2001 From: Jack Shirazi Date: Thu, 23 Nov 2023 09:48:38 +0000 Subject: [PATCH] cleanup the rushed #3436 PR --- .../co/elastic/apm/agent/bci/InstrumentationTest.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) 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()); }