diff --git a/.travis.yml b/.travis.yml index d54f7a719..178a80fec 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,8 @@ env: - TERM=dumb global: - secure: ZYDSu09ecVRgxB0oRHaOFSj2InEgpAcQLJKnrr24vfCD4+RncHzAJqqGoUbe0eiajTnybJppiuscoQTh+yPmuF4TPTIvRZa87VP9xGZRs1r6hbw6XUtvyBIZx4yVVr0+69hIQ/LTQSHTl3l7WIXXTw/ZgN3PD8Hm/KdSlUkUXQk= - - GRADLE_OPTS="-Xms256m" + - GRADLE_OPTS="-Xms128m" + # -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled before_install: - chmod +x gradlew diff --git a/build.gradle b/build.gradle index c64bbb9d1..01c6a4cc9 100644 --- a/build.gradle +++ b/build.gradle @@ -63,16 +63,20 @@ subprojects { //options.incremental = true } - // Limit test memory to simulate travis ci. Other memory settings are - // to encourage Travis to not kill the build due to using too much memory - // https://discuss.gradle.org/t/travis-ci-org-gradle-launcher-daemon-client-daemondisappearedexception-gradle-build-daemon-disappeared-unexpectedly-it-may-have-been-killed-or-may-have-crashed/13106/3 - // TravisCI sometimes doesn't give you all the memory it should: - // https://github.com/urho3d/Urho3D/issues/651 + /* + * Running tests takes up a lot of memory and TravisCI only has 3-4 gb available. + * Use a low value of forkEvery to ensure heap is started fresh every few classes. + * Limit max heap size to simulate TravisCI environment. + * Relevant TravisCI building issues: + * - https://discuss.gradle.org/t/travis-ci-org-gradle-launcher-daemon-client-daemondisappearedexception-gradle-build-daemon-disappeared-unexpectedly-it-may-have-been-killed-or-may-have-crashed/13106/3 + * - https://github.com/urho3d/Urho3D/issues/651 + */ tasks.withType(Test) { // maxParallelForks = Runtime.runtime.availableProcessors() maxParallelForks = 2 minHeapSize = '256m' - maxHeapSize = '2g' + maxHeapSize = '1500m' + forkEvery = 20 } // This is just to show off API usage. No tests needed. @@ -118,11 +122,12 @@ task jacocoTestReport(type: org.gradle.testing.jacoco.tasks.JacocoReport) { } if (System.env.TRAVIS == 'true') { - allprojects { - tasks.withType(Test) { - testLogging { - events "started", "passed", "skipped", "failed" + allprojects { + tasks.withType(Test) { + testLogging { + // Printing out status of each test makes following and debugging builds easier. + events "started", "passed", "skipped", "failed" + } } } - } }