Hello,
we are
currently migrating from maven to gradle and our java build contains currently
at least 25 modules with tests. The build is working very well (incl. prallel
builds) except with following use case:
When I
execute a full parallel build, then the execution of the task test is running
into a StackOverflowError:
:moduleXY:test
Unexpected
exception thrown.
java.lang.StackOverflowError
at
java.security.AccessController.doPrivileged(Native Method)
at
java.io.ObjectStreamClass.(ObjectStreamClass.java:455)
at
java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:352)
at java.io.ObjectStreamClass.<init>(ObjectStreamClass.java:451)
at
java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:352)
at
java.io.ObjectStreamClass.(ObjectStreamClass.java:451)
at
java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:352)
at
java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1130)
at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1528)
at
java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1493)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416)
at
java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174)
at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1528)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1493)
at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416)
at
java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1528)
at
java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1493)
at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174)
at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1528)
at
java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1493)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416)
at
java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174)
… and so
on
The gradle
process does not terminate after the error above. The process seems to be in a
frozen state. When I abort the process and restart the all tests again
(incremental execution of the module tests), then the StackOverflowError does
not occur. As far as I can see from the log output (gradle started with
activated debug logger) all tests of all modules were executed. According to
the log output gradle starts for each module a “Gradle Test Executor” and
according to the output all Executors were completed:
For each
instantiated test executor following lines exists in the log output:
[QUIET]
[system.out] 11:47:30.216 [DEBUG]
[org.gradle.process.internal.child.ActionExecutionWorker] Completed Gradle Test
Executor 26.
And also following
line (except for one test executor):
[DEBUG]
[org.gradle.process.internal.DefaultExecHandle] Process ‘Gradle Test Executor
26’ finished with exit value 0 (state: SUCCEEDED)
To
reproduce this issue I execute a “full build” by following steps:
-
gradlew
clean -
gradlew
assemble -
gradlew
testClasses -
gradlw
test (-> the StackOverflowError occurs)
This issue
occurs with gradle 2.6, 2.7, 2.8 and 2.9.
I would
like to provide more information, but I do not know how to get more details.
Kind
Regards
Markus