Hello, I’m having trouble running gradle on travis ci.
I will start by saying the same gradle commands run fine on my macbook pro.
Details about the project:
JDK 8 oracle
Multi-project
Travis runs these 2 commands:
gradle assemble
gradle check
Both of them seems to output the same text locally and on Travis VM, but on Travis it suddenly fails:
$ gradle check
[/home/travis/build/1/2/3/src]
[/home/travis/build/1/2/3/test]
[/home/travis/build/0/1/5/src]
[/home/travis/build/0/1/5/test]
[/home/travis/build/0/1/4/src]
[/home/travis/build/0/1/4/test]
:4:compileJava UP-TO-DATE
:4:processResources UP-TO-DATE
:4:classes UP-TO-DATE
:4:jar UP-TO-DATE
:5:compileJava UP-TO-DATE
:5:processResources UP-TO-DATE
:5:classes UP-TO-DATE
:5:jar UP-TO-DATE
:3:compileJava UP-TO-DATE
:3:processResources UP-TO-DATE
:3:classes UP-TO-DATE
:3:compileTestJava
Download https://repo1.maven.org/maven2/junit/junit/4.12/junit-4.12.pom
Download https://repo1.maven.org/maven2/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.pom
Download https://repo1.maven.org/maven2/org/hamcrest/hamcrest-parent/1.3/hamcrest-parent-1.3.pom
Download https://repo1.maven.org/maven2/junit/junit/4.12/junit-4.12.jar
Download https://repo1.maven.org/maven2/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
:3:processTestResources
:3:testClasses
:3:test FAILED
FAILURE: Build failed with an exception.
- What went wrong:
Execution failed for task ‘:3:test’.
Process ‘Gradle Test Executor 1’ finished with non-zero exit value 137
- Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.```
So I changed the script to run
gradle assemble
gradle check --debug
And the result is attached below.
The first line is still a line my test printed to the console, later it suddenly fails
16:23:39.545 [DEBUG] [TestEventLogger] 30689
16:23:40.568 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Changing state to: FAILED
16:23:40.574 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Process ‘Gradle Test Executor 1’ finished with exit value 137 (state: FAILED)
16:23:40.586 [DEBUG] [TestEventLogger]
16:23:40.587 [DEBUG] [TestEventLogger] Test Run PASSED
16:23:40.587 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter] Finished executing task ‘:2:test’
16:23:40.588 [LIFECYCLE] [class org.gradle.TaskExecutionLogger] :2:test FAILED
16:23:40.589 [INFO] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] :2:test (Thread[main,5,main]) completed. Took 20.59 secs.
16:23:40.589 [DEBUG] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] Task worker [Thread[main,5,main]] finished, busy: 41.881 secs, idle: 0.018 secs
16:23:40.605 [ERROR] [org.gradle.BuildExceptionReporter]
16:23:40.605 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception.
16:23:40.606 [ERROR] [org.gradle.BuildExceptionReporter]
16:23:40.606 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong:
16:23:40.606 [ERROR] [org.gradle.BuildExceptionReporter] Execution failed for task ‘:2:test’.
16:23:40.606 [ERROR] [org.gradle.BuildExceptionReporter] > Process ‘Gradle Test Executor 1’ finished with non-zero exit value 137
16:23:40.606 [ERROR] [org.gradle.BuildExceptionReporter]
16:23:40.606 [ERROR] [org.gradle.BuildExceptionReporter] * Try:
16:23:40.606 [ERROR] [org.gradle.BuildExceptionReporter] Run with --stacktrace option to get the stack trace.
16:23:40.607 [LIFECYCLE] [org.gradle.BuildResultLogger]
16:23:40.607 [LIFECYCLE] [org.gradle.BuildResultLogger] BUILD FAILED
16:23:40.607 [LIFECYCLE] [org.gradle.BuildResultLogger]
16:23:40.607 [LIFECYCLE] [org.gradle.BuildResultLogger] Total time: 47.366 secs
16:23:40.608 [DEBUG] [org.gradle.api.internal.tasks.compile.daemon.CompilerDaemonManager] Stopping 0 compiler daemon(s).
16:23:40.608 [INFO] [org.gradle.api.internal.tasks.compile.daemon.CompilerDaemonManager] Stopped 0 compiler daemon(s).
16:23:40.608 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on buildscript class cache for settings file ‘/home/travis/build/0/1/settings.gradle’ (/home/travis/.gradle/caches/2.2.1/scripts/settings_b28kas7lah6wnh2vb3il7u0og/SettingsScript/buildscript).
16:23:40.608 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on no_buildscript class cache for settings file ‘/home/travis/build/0/1/settings.gradle’ (/home/travis/.gradle/caches/2.2.1/scripts/settings_b28kas7lah6wnh2vb3il7u0og/SettingsScript/no_buildscript).
16:23:40.609 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on buildscript class cache for build file ‘/home/travis/build/0/1/build.gradle’ (/home/travis/.gradle/caches/2.2.1/scripts/build_axqm1bna1fcdvw3x2gkv54wac/ProjectScript/buildscript).
16:23:40.609 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on no_buildscript class cache for build file ‘/home/travis/build/0/1/build.gradle’ (/home/travis/.gradle/caches/2.2.1/scripts/build_axqm1bna1fcdvw3x2gkv54wac/ProjectScript/no_buildscript).
16:23:40.609 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on buildscript class cache for build file ‘/home/travis/build/0/1/2/build.gradle’ (/home/travis/.gradle/caches/2.2.1/scripts/build_6wh1mhv7ftm2br6dsk1yfj7v/ProjectScript/buildscript).
16:23:40.609 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on no_buildscript class cache for build file ‘/home/travis/build/0/1/2/build.gradle’ (/home/travis/.gradle/caches/2.2.1/scripts/build_6wh1mhv7ftm2br6dsk1yfj7v/ProjectScript/no_buildscript).
16:23:40.609 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on buildscript class cache for build file ‘/home/travis/build/0/1/5/build.gradle’ (/home/travis/.gradle/caches/2.2.1/scripts/build_7yy0sjvqcfmelr7bac2r9u5ma/ProjectScript/buildscript).
16:23:40.610 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on no_buildscript class cache for build file ‘/home/travis/build/0/1/5/build.gradle’ (/home/travis/.gradle/caches/2.2.1/scripts/build_7yy0sjvqcfmelr7bac2r9u5ma/ProjectScript/no_buildscript).
16:23:40.610 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on buildscript class cache for build file ‘/home/travis/build/0/1/4/build.gradle’ (/home/travis/.gradle/caches/2.2.1/scripts/build_1d6735qorxdm3f84qayxu4n8e/ProjectScript/buildscript).
16:23:40.612 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on no_buildscript class cache for build file ‘/home/travis/build/0/1/4/build.gradle’ (/home/travis/.gradle/caches/2.2.1/scripts/build_1d6735qorxdm3f84qayxu4n8e/ProjectScript/no_buildscript).
16:23:40.620 [DEBUG] [org.gradle.cache.internal.btree.BTreePersistentIndexedCache] Closing cache fileHashes.bin (/home/travis/build/0/1/.gradle/2.2.1/taskArtifacts/fileHashes.bin)
16:23:40.621 [DEBUG] [org.gradle.cache.internal.btree.BTreePersistentIndexedCache] Closing cache fileSnapshots.bin (/home/travis/build/0/1/.gradle/2.2.1/taskArtifacts/fileSnapshots.bin)
16:23:40.621 [DEBUG] [org.gradle.cache.internal.btree.BTreePersistentIndexedCache] Closing cache outputFileStates.bin (/home/travis/build/0/1/.gradle/2.2.1/taskArtifacts/outputFileStates.bin)
16:23:40.621 [DEBUG] [org.gradle.cache.internal.btree.BTreePersistentIndexedCache] Closing cache taskArtifacts.bin (/home/travis/build/0/1/.gradle/2.2.1/taskArtifacts/taskArtifacts.bin)
16:23:40.622 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on task history cache (/home/travis/build/0/1/.gradle/2.2.1/taskArtifacts).
16:23:40.622 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on cache directory workerMain (/home/travis/.gradle/caches/2.2.1/workerMain).
16:23:40.632 [DEBUG] [org.gradle.cache.internal.DefaultCacheAccess] Cache Plugin Resolution Cache (/home/travis/.gradle/caches/2.2.1/plugin-resolution) was closed 0 times.
16:23:40.632 [DEBUG] [org.gradle.cache.internal.btree.BTreePersistentIndexedCache] Closing cache artifact-at-repository.bin (/home/travis/.gradle/caches/modules-2/metadata-2.14/artifact-at-repository.bin)
16:23:40.632 [DEBUG] [org.gradle.cache.internal.btree.BTreePersistentIndexedCache] Closing cache module-artifacts.bin (/home/travis/.gradle/caches/modules-2/metadata-2.14/module-artifacts.bin)
16:23:40.633 [DEBUG] [org.gradle.cache.internal.btree.BTreePersistentIndexedCache] Closing cache module-metadata.bin (/home/travis/.gradle/caches/modules-2/metadata-2.14/module-metadata.bin)
16:23:40.633 [DEBUG] [org.gradle.cache.internal.btree.BTreePersistentIndexedCache] Closing cache artifact-at-url.bin (/home/travis/.gradle/caches/modules-2/metadata-2.14/artifact-at-url.bin)
16:23:40.633 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on artifact cache (/home/travis/.gradle/caches/modules-2).
16:23:40.634 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.resolveengine.store.CachedStoreFactory] Resolution result cache closed. Cache reads: 0, disk reads: 0 (avg: 0.0 secs, total: 0.0 secs)
16:23:40.634 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.resolveengine.store.CachedStoreFactory] Resolved configuration cache closed. Cache reads: 0, disk reads: 0 (avg: 0.0 secs, total: 0.0 secs)
16:23:40.634 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.resolveengine.store.ResolutionResultsStoreFactory] Deleted 2 resolution results binary files in 0.001 secs
16:23:40.635 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.ivyresolve.memcache.InMemoryCachedRepositoryFactory] In-memory dependency metadata cache closed. Repos cached: 5, cache instances: 1, modules served from cache: 171, artifacts: 167