Skip to content

Commit

Permalink
Only honour singleton-ness on interceptor, not JUnit runner
Browse files Browse the repository at this point in the history
  • Loading branch information
holly-cummins committed Jan 15, 2025
1 parent bfd8484 commit d272661
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -779,6 +779,7 @@ private DiscoveryResult discoverTestClasses() {
// TODO this seems logical, but DOES NOT makes integration-test/test-extension/tests fail
ClassLoader parent = ClassLoader.getSystemClassLoader();
System.out.println("HOLLY using parent for facade loader " + parent);
FacadeClassLoader.clearSingleton();
FacadeClassLoader facadeClassLoader = FacadeClassLoader.instance(parent); // TODO ideally it would be in a different module, but that is hard CollaboratingClassLoader.construct(parent);

facadeClassLoader.setAuxiliaryApplication(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ public class FacadeClassLoader extends ClassLoader implements Closeable {

private static volatile FacadeClassLoader instance;

public static void clearSingleton() {
instance = null;
}

// TODO does it make sense to have a parent here when it is sometimes ignored?
// We don't ever want more than one FacadeClassLoader active, especially since config gets initialised on it.
// The gradle test execution can make more than one, perhaps because of its threading model.
Expand Down

0 comments on commit d272661

Please sign in to comment.