Gradle test hangs forever without any error message

I have a project where when I run gradle clean test, it will hang forever without any error message. I tried to run different unit tests, single ones. My project has got both groovy/java tests but it’s the same result for any of them. I have no problem running the tests in Intellij IDEA. I have tried with gradle 1.12 and 2.0, same result.

Here is where it hangs with --debug:

And now is the output when I do kill -3 (sorry, this is quite long):

And this is from another gradle process where I did kill -3 as well:

Note that in the stacktraces of kill -3, there is nothing about my code. Any help would be much appreciated.

Hi Marc,

Are there no other processes? Your first process is Gradle, the second is a compiler daemon. I would expect to see another process which is running the tests.

Is there any chance you could create a reproducible sample that we can run?

Indeed, there are 3 processes.

The output after I did kill -3 on the 3 of them:

About creating a reproducible sample, I will give it a try but it might be difficult because this is happening on a big project with lot of dependencies on other projects. I have a similar setup on a different smaller project but there is no problem there. I’ll try to make it happen on something smaller which I could give you.

I am lucky, I managed to create a small project where I can reproduce the problem.

You can clone it here: git clone

Run “gradle clean test” and it will hang forever.

Although with this little project I can see 1 thing more in the logs:

13:05:10.837 [DEBUG] [org.gradle.cache.internal.DefaultCacheAccess] Detected file lock contention of artifact cache (/home/marc/.gradle/caches/modules-2) (fileLock=true, contended=false, owner=null)
13:05:10.840 [DEBUG] [org.gradle.cache.internal.btree.BTreePersistentIndexedCache] Closing cache artifact-at-repository.bin (/home/marc/.gradle/caches/modules-2/metadata-2.12/artifact-at-repository.bin)
13:05:10.840 [DEBUG] [org.gradle.cache.internal.btree.BTreePersistentIndexedCache] Closing cache module-metadata.bin (/home/marc/.gradle/caches/modules-2/metadata-2.12/module-metadata.bin)
13:05:10.845 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on artifact cache (/home/marc/.gradle/caches/modules-2).

Thank you in advance for your help.

I found the source of the problem:


If I remove this dependency it doesn’t hang anymore.

And so it turns out there is some incompatibility issue between the jacoco and the jmockit versions I use:

Hi Marc,

I can’t clone that project without a password. I’d still like to pursue this to see if we can catch this kind of exception and provide better feedback.

Sorry, you should actually clone with: git clone git://

This doesn’t build. It requires connectivity to http://ukicdjabroni.

In the repositories section, remove:

maven {
                url "http://ukicdjabroni/repository/"
          maven {
                url "http://ukicdjabroni/snapshots/"