I have a Test target that includes only one JUnit test category:
task acceptanceTest(type:Test) {
useJUnit {
includeCategories 'org.apache.geode.test.junit.categories.AcceptanceTest'
}
forkEvery 1
}
I only have a single Test class that is annotated with this Category. Yet, it looks like there are hundreds of Gradle Executor Threads being spun up needlessly:
Starting process 'Gradle Test Executor 1'. Working directory: /myProjectDir/build/acceptanceTest Command: /Library/Java/JavaVirtualMachines/jdk1.8.0_102.jdk/Contents/Home/bin/java /myProjectDir/-Dgemfire.disallowMcastDefaults=true -Djava.security.manager=worker.org.gradle.process.internal.worker.child.BootstrapSecurityManager -Djline.terminal=jline.UnsupportedTerminal -XX:+HeapDumpOnOutOfMemoryError -Xmx768m -Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en -Duser.variant -ea -cp /Users/jstewart/.gradle/caches/2.14.1/workerMain/gradle-worker.jar worker.org.gradle.process.internal.worker.GradleWorkerMain 'Gradle Test Executor 1'
Successfully started process 'Gradle Test Executor 1'
Gradle Test Executor 1 started executing tests.
Gradle Test Executor 1 finished executing tests.
Starting process 'Gradle Test Executor 2'. Working directory: /myProjectDir/build/acceptanceTest Command: /Library/Java/JavaVirtualMachines/jdk1.8.0_102.jdk/Contents/Home/bin/java /myProjectDir/-Dgemfire.disallowMcastDefaults=true -Djava.security.manager=worker.org.gradle.process.internal.worker.child.BootstrapSecurityManager -Djline.terminal=jline.UnsupportedTerminal -XX:+HeapDumpOnOutOfMemoryError -Xmx768m -Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en -Duser.variant -ea -cp /Users/jstewart/.gradle/caches/2.14.1/workerMain/gradle-worker.jar worker.org.gradle.process.internal.worker.GradleWorkerMain 'Gradle Test Executor 2'
Successfully started process 'Gradle Test Executor 2'
Gradle Test Executor 2 started executing tests.
Gradle Test Executor 2 finished executing tests.
Starting process 'Gradle Test Executor 3'. Working directory: /myProjectDir/build/acceptanceTest Command: /Library/Java/JavaVirtualMachines/jdk1.8.0_102.jdk/Contents/Home/bin/java /myProjectDir/-Dgemfire.disallowMcastDefaults=true -Djava.security.manager=worker.org.gradle.process.internal.worker.child.BootstrapSecurityManager -Djline.terminal=jline.UnsupportedTerminal -XX:+HeapDumpOnOutOfMemoryError -Xmx768m -Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en -Duser.variant -ea -cp /Users/jstewart/.gradle/caches/2.14.1/workerMain/gradle-worker.jar worker.org.gradle.process.internal.worker.GradleWorkerMain 'Gradle Test Executor 3'
Successfully started process 'Gradle Test Executor 3'
Gradle Test Executor 3 started executing tests.
Gradle Test Executor 3 finished executing tests.
Starting process 'Gradle Test Executor 4'. Working directory: /myProjectDir/build/acceptanceTest Command: /Library/Java/JavaVirtualMachines/jdk1.8.0_102.jdk/Contents/Home/bin/java /myProjectDir/-Dgemfire.disallowMcastDefaults=true -Djava.security.manager=worker.org.gradle.process.internal.worker.child.BootstrapSecurityManager -Djline.terminal=jline.UnsupportedTerminal -XX:+HeapDumpOnOutOfMemoryError -Xmx768m -Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en -Duser.variant -ea -cp /Users/jstewart/.gradle/caches/2.14.1/workerMain/gradle-worker.jar worker.org.gradle.process.internal.worker.GradleWorkerMain 'Gradle Test Executor 4'
Successfully started process 'Gradle Test Executor 4'
Gradle Test Executor 4 started executing tests.
Gradle Test Executor 4 finished executing tests.
Starting process 'Gradle Test Executor 5'. Working directory: /myProjectDir/build/acceptanceTest Command: /Library/Java/JavaVirtualMachines/jdk1.8.0_102.jdk/Contents/Home/bin/java /myProjectDir/-Dgemfire.disallowMcastDefaults=true -Djava.security.manager=worker.org.gradle.process.internal.worker.child.BootstrapSecurityManager -Djline.terminal=jline.UnsupportedTerminal -XX:+HeapDumpOnOutOfMemoryError -Xmx768m -Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en -Duser.variant -ea -cp /Users/jstewart/.gradle/caches/2.14.1/workerMain/gradle-worker.jar worker.org.gradle.process.internal.worker.GradleWorkerMain 'Gradle Test Executor 5'
Successfully started process 'Gradle Test Executor 5'
Gradle Test Executor 5 started executing tests.
Gradle Test Executor 5 finished executing tests.
Starting process 'Gradle Test Executor 6'. Working directory: /myProjectDir/build/acceptanceTest Command: /Library/Java/JavaVirtualMachines/jdk1.8.0_102.jdk/Contents/Home/bin/java /myProjectDir/-Dgemfire.disallowMcastDefaults=true -Djava.security.manager=worker.org.gradle.process.internal.worker.child.BootstrapSecurityManager -Djline.terminal=jline.UnsupportedTerminal -XX:+HeapDumpOnOutOfMemoryError -Xmx768m -Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en -Duser.variant -ea -cp /Users/jstewart/.gradle/caches/2.14.1/workerMain/gradle-worker.jar worker.org.gradle.process.internal.worker.GradleWorkerMain 'Gradle Test Executor 6'
Successfully started process 'Gradle Test Executor 6'
Gradle Test Executor 6 started executing tests.
Gradle Test Executor 6 finished executing tests.
My guess is that perhaps Gradle is spinning up an Executor for each test class before it has applied the filter of the AcceptanceTest JUnit category? I would appreciate any help.