Gradle hangs indefinately after finishing tests run in parallel

I’m going to mark this down as a duplicate of http://forums.gradle.org/gradle/topics/strange_exception_thrown_running_unit_tests.

The symptom may not be the same, but I think it’s the same root cause.