(M5 / M6) Cannot lock the artifact cache, as it is already locked by this process


(jburbridge) #1

Seems like both milestone-5 and milestone-6 (I haven’t tried M4) are having concurrency issues with cobertura during testRuntime if test forking and module dependencies are present at the same time.

Here’s a simple project that reproduces the issue: https://github.com/johnburbridge/gradleBug/blob/master/build.gradle

Note that this works fine when commenting out either this:

test {
    forkEvery = 1;
    maxParallelForks = 2;
}

or this:

axisGenAntTask module('org.apache.axis:axis:1.4') {
        dependency 'javax.xml:jaxrpc-api:1.1';
        dependency 'axis:axis-wsdl4j:1.5.1';
        dependency 'commons-discovery:commons-discovery:0.2';
        dependency 'commons-codec:commons-codec:1.3';
        dependency 'javax.mail:mail:1.3.1';
    }

But the combination of both causes this:

FAILURE: Build failed with an exception.
  * What went wrong:
Execution failed for task ':test'.
Cause: Could not resolve all dependencies for configuration ':testRuntime'.
Cause: Cannot lock the artifact cache, as it is already locked by this process.

Also, interesting that setting forkEvery = 0 doesn’t help any though one would expect that should help.

This works fine under milestone-3 provided you update mavenRepo url to urls.

HTH!