I tried sifting through Gradle on Github but the answer was not clear.
Say I have the following configuration:
tasks.withType(Test) {
maxParallelForks = 8
}
And I have 2,000 tests to run. Does a single fork run multiple tests in parallel within its own process? Basically would a static variable need to be thread-safe when running tests.
You’ll have to set the forkEvery property to a value greater than zero to start using parallel forks. Each fork is a separate jvm so each will have its own copy of any static variables.
tasks.withType(Test) {
maxParallelForks = 8
forkEvery = 10 // each fork will execute a maximum of 10 test classes
}