Build cache does not cache test runs

As far as I can see the property hashes match. This console output with --info is the same in first and second runs:

Appending outputPropertyName to build cache key: binResultsDir
Appending outputPropertyName to build cache key: jacoco.destinationFile
Appending outputPropertyName to build cache key: reports.enabledDirectoryReportDestinations.html
Appending outputPropertyName to build cache key: reports.enabledDirectoryReportDestinations.junitXml
Build cache key for task ':scanner:funTest' is 4b571eaf8c9001c727ab7519044030f0

But I saw

Caching disabled for task ':scanner:funTest': 'JaCoCo agent configured with `append = true`' satisfied

Luckily, @sterling has proposed a work-around for this already!