You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, when running forked tests, SBT uses the number of cores available to the machine:
See ForkMain.scala
privateExecutorService executorService(
finalForkConfiguration config, finalObjectOutputStream os) {
if (config.isParallel()) {
final int nbThreads =Runtime.getRuntime().availableProcessors();
logDebug(os, "Create a test executor with a thread pool of "+ nbThreads +" threads.");
// more options later...// TODO we might want to configure the blocking queue with size #procreturnExecutors.newFixedThreadPool(nbThreads);
} else {
logDebug(os, "Create a single-thread test executor");
returnExecutors.newSingleThreadExecutor();
}
}
expectation
testForkedParallel should use the same concurrentRestrictions mechanism to limit the number of in-flight tests OR provide some other setting. (e.g., testForkedParallism := 2).
notes
There is a workaround for this which is configuring the number of cores exposed to the JVM via javaOptions:
Test / javaOptions ++=
// Limit to two test threads
Seq(
"-XX:ActiveProcessorCount=2",
)
The text was updated successfully, but these errors were encountered:
steps
Configure a project to run its forked tests in parallel:
problem
When running non-forked tests in parallel the use of concurrent restrictions limits the number of in-flight tests:
However, when running forked tests, SBT uses the number of cores available to the machine:
See ForkMain.scala
expectation
testForkedParallel
should use the same concurrentRestrictions mechanism to limit the number of in-flight tests OR provide some other setting. (e.g., testForkedParallism := 2).notes
There is a workaround for this which is configuring the number of cores exposed to the JVM via javaOptions:
The text was updated successfully, but these errors were encountered: