I believe Gradle TestKit daemons are shut down by the DefaultGradleConnector.close()
call, which is executed by a JVM shutdown hook that gets registered in ToolingApiGradleExecutor.maybeRegisterCleanup
.
The current Javadocs of DefaultGradleConnector.close()
:
Closes the tooling API, releasing all resources. Blocks until completed.
May attempt to expire some or all daemons started by this tooling API client. The exact behaviour here is implementation-specific and not guaranteed.
The expiration is best effort only. This method may return before the daemons have stopped.Note: this is not yet part of the public tooling API yet.
Not sure whether this helps anyone, but added it for the record.