Home:ALL Converter>Gradle integrationTest target fails with exit code 137

Gradle integrationTest target fails with exit code 137

Ask Time:2019-03-18T23:21:32         Author:Chris F

Json Formatter

I'm aware of Why are my Gradle builds dying with exit-code 137? but that deals with the test target? In my case, my unit tests pass, but the integrationTest target fails with exit code 137.

$ ./gradlew --version    
Welcome to Gradle 4.7!

Here are the highlights of this release:
 - Incremental annotation processing
 - JDK 10 support
 - Grouped non-interactive console logs
 - Failed tests are re-run first for quicker feedback

For more details see https://docs.gradle.org/4.7/release-notes.html


------------------------------------------------------------
Gradle 4.7
------------------------------------------------------------

Build time:   2018-04-18 09:09:12 UTC
Revision:     b9a962bf70638332300e7f810689cb2febbd4a6c

Groovy:       2.4.12
Ant:          Apache Ant(TM) version 1.9.9 compiled on February 2 2017
JVM:          1.8.0_191 (Oracle Corporation 25.191-b12)
OS:           Linux 4.14.94-89.73.amzn2.x86_64 amd64

$ ./gradlew :project:integrationTest
...
> Process 'Gradle Test Executor 1' finished with non-zero exit value 137

I have the following JvmArgs settings, but they don't see to affect the integrationTest target, only the test target?

apply plugin: 'java'
test {
    failFast = true
    maxParallelForks = 2
    maxHeapSize = '2g'
    forkEvery = 100   // helps when tests leak memory
    jvmArgs '-Xss1m', '-Xms128m', '-Xmx2g',
            '-XX:+UnlockExperimentalVMOptions',
            '-XX:+UseCGroupMemoryLimitForHeap',
            '-XX:+PrintGCDetails',
            '-XX:+PrintGCDateStamps',
            '-XX:+PrintTenuringDistribution',
            '-XX:+PrintGCCause',
            '-XX:+UseGCLogFileRotation',
            '-XX:NumberOfGCLogFiles=10',
            '-XX:GCLogFileSize=5M',
            '-Xloggc:/tmp/fs_oom.log',
            '-XX:+HeapDumpOnOutOfMemoryError',
            '-XX:HeapDumpPath=/tmp/fs_oom_err_pid<pid>.hprof',
            '-XX:+UseGCOverheadLimit',
            '-XX:OnError=cat /tmp/fs_oom.log',
            '-XX:OnOutOfMemoryError=cat /tmp/fs_oom_err_pid<pid>.hprof'
}
integrationTest.failFast = test.failFast
integrationTest.maxParallelForks = test.maxParallelForks
integrationTest.maxHeapSize = test.maxHeapSize
integrationTest.forkEvery = test.forkEvery
integrationTest.jvmArgs = test.jvmArgs

What else can I do to workaround this?

Author:Chris F,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/55224645/gradle-integrationtest-target-fails-with-exit-code-137
yy