I have a Spock test that uses a GPars pool to execute parts of the test using multiple threads. Each of the Threads can throw a SpockAssertionError.
If that happens, it will lead to an error when trying to write the test results:
...
Caused by: java.lang.IllegalArgumentException: Cannot encode a null string.
at org.gradle.internal.serialize.kryo.KryoBackedEncoder.writeString(KryoBackedEncoder.java:68)
at org.gradle.api.internal.tasks.testing.junit.result.TestResultSerializer.write(TestResultSerializer.java:85)
at org.gradle.api.internal.tasks.testing.junit.result.TestResultSerializer.write(TestResultSerializer.java:72)
at org.gradle.api.internal.tasks.testing.junit.result.TestResultSerializer.write(TestResultSerializer.java:62)
at org.gradle.api.internal.tasks.testing.junit.result.TestResultSerializer.write(TestResultSerializer.java:48)
at org.gradle.api.tasks.testing.Test.executeTests(Test.java:536)
I can reproduce this with Gradle 2.4, 2.3, and 2.2.