I’m testing my plugin against multiple versions in a unit test. Therefor i use the GradleRunner
GradleRunner.create()
.withDebug(true)
.withProjectDir(projectDir)
.withPluginClasspath()
.forwardOutput()
.withGradleVersion(version)
.build()
version is a parameter of my parameterized test
after some versions have been tested i’m running in an OutOfMemoryError (see Update Gradle Wrapper from 8.8 to 8.9. · gradle-dependency-analyze/gradle-dependency-analyze@c0aa42a (github.com)
i already tried to create for each test inside the project a gradle.properties
file with the content
props.setProperty("org.gradle.daemon", "false")
props.setProperty("org.gradle.vfs.watch", "false")
to not spawn daemons and also disable file system watching
when attaching jconsole i see for each tested version threads still running after the version was tested
how to properly shut down the GradleRunner in my test so that i do not run in the OOM situation.
Increasing xmx i would like to avoid as this does not solve the underlaying problem