Skip to content

Commit df5b8cf

Browse files
committed
Ensure that FJP threads can load resources in tests
Fixes: #50617
1 parent c3944a9 commit df5b8cf

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

test-framework/junit5/src/main/java/io/quarkus/test/junit/launcher/CustomLauncherInterceptor.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,11 @@ public void launcherDiscoveryStarted(LauncherDiscoveryRequest request) {
8787
if (!isProductionModeTests()) {
8888
initializeFacadeClassLoader();
8989
adjustContextClassLoader();
90+
91+
// we need to ensure that the Fork-Join pool will use our thread factory, otherwise the TCCL
92+
// of the threads could be wrong
93+
System.setProperty("java.util.concurrent.ForkJoinPool.common.threadFactory",
94+
"io.quarkus.bootstrap.forkjoin.QuarkusForkJoinWorkerThreadFactory");
9095
}
9196

9297
}

0 commit comments

Comments
 (0)