From 632914f08a0c0d1e620ff6c280fb618346e246c3 Mon Sep 17 00:00:00 2001 From: Holly Cummins Date: Mon, 20 Jan 2025 17:14:32 +0000 Subject: [PATCH] Novel idea: actually implement close method to tidy up classloaders to try and avoid memory leaks --- .../quarkus/test/junit/classloading/FacadeClassLoader.java | 5 +++-- .../test/junit/util/QuarkusTestProfileAwareClassOrderer.java | 1 - 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/deployment/src/main/java/io/quarkus/test/junit/classloading/FacadeClassLoader.java b/core/deployment/src/main/java/io/quarkus/test/junit/classloading/FacadeClassLoader.java index 76f103616533a..74077a1599a84 100644 --- a/core/deployment/src/main/java/io/quarkus/test/junit/classloading/FacadeClassLoader.java +++ b/core/deployment/src/main/java/io/quarkus/test/junit/classloading/FacadeClassLoader.java @@ -686,8 +686,9 @@ public String getName() { @Override public void close() { - // TODO clearly, an implementation is needed! - + for (CuratedApplication curatedApplication : curatedApplications.values()) { + curatedApplication.close(); + } } public void setProfiles(Map profiles) { diff --git a/test-framework/junit5/src/main/java/io/quarkus/test/junit/util/QuarkusTestProfileAwareClassOrderer.java b/test-framework/junit5/src/main/java/io/quarkus/test/junit/util/QuarkusTestProfileAwareClassOrderer.java index 592ec0ed108f5..5bc8aba428310 100644 --- a/test-framework/junit5/src/main/java/io/quarkus/test/junit/util/QuarkusTestProfileAwareClassOrderer.java +++ b/test-framework/junit5/src/main/java/io/quarkus/test/junit/util/QuarkusTestProfileAwareClassOrderer.java @@ -106,7 +106,6 @@ public QuarkusTestProfileAwareClassOrderer() { @Override public void orderClasses(ClassOrdererContext context) { - System.out.println("HOLLY YUP YUP ordering classes"); // don't do anything if there is just one test class or the current order request is for @Nested tests if (context.getClassDescriptors() .size() <= 1 || context.getClassDescriptors()