From 65b30216b7181d43a7b14b419d0b2c0c8d0cb1bb Mon Sep 17 00:00:00 2001 From: Jack Shirazi Date: Wed, 22 Nov 2023 13:22:26 +0000 Subject: [PATCH] add finalization to InstrumentationTest --- .../test/java/co/elastic/apm/agent/bci/InstrumentationTest.java | 2 ++ 1 file changed, 2 insertions(+) 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 6003e1ee56..22556649aa 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 @@ -447,6 +447,8 @@ void testNoClassLoaderLeakWhenInstrumentedApplicationIsUndeployed() throws Excep System.gc(); System.gc(); + Runtime.getRuntime().runFinalization(); + System.gc(); await().untilAsserted(() -> assertThat(applicationCLRef.get()).isNull()); }