Skip to content

Commit 1c0a6f0

Browse files
committed
Don't use more than availableProcessors threads for parallel tests in ContextLocalTest using vthreads.
1 parent 4372d25 commit 1c0a6f0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/polyglot/ContextLocalTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ public String get(Thread t) {
156156
}
157157

158158
private static void runInParallel(boolean vthreads, Runnable callable) throws InterruptedException, ExecutionException {
159-
ExecutorService executor = threadPool(PARALLELISM, vthreads);
159+
ExecutorService executor = threadPool(vthreads ? Math.min(PARALLELISM, Runtime.getRuntime().availableProcessors()) : PARALLELISM, vthreads);
160160
List<Future<?>> futures = new ArrayList<>();
161161
/*
162162
* For virtual threads, we want a number of iterations well above the maxPoolSize of

0 commit comments

Comments
 (0)