Windows build hangs after Done exit 0


My build for Windows fails to stop after successful build.

My .travis.yml is as follows:

    - os: linux
      language: java
      sudo: false # for faster builds
      jdk: openjdk11
    - os: osx
      language: java
      sudo: false # for faster builds
      jdk: openjdk11
    - os: windows
      language: c # 'java' not supported, 'generic' causes VM to hang on boot.
      sudo: false # for faster builds
  - |
    if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then
      choco install -y openjdk --version 11.0
      export JAVA_HOME="/c/Program Files/OpenJDK/jdk-11"
      export PATH="$JAVA_HOME/bin:$PATH"
      gem install bundle
  - chmod +x gradlew
  - |
    if [[ "$TRAVIS_OS_NAME" != "windows" ]]; then
      ./gradlew check
      ./gradlew test jacocoTestReport
  - ./gradlew jar
  - java -jar build/http-server.jar &
  - cd acceptance-tests
  - bundle install
  - bundle exec spinach
  - kill %1
  - cd ..
  - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then bash <(curl -s; fi
  - travis_terminate 0 # try to make Windows quit

Any thoughts or suggestions to fix this?


The problem seems to be related to the Gradle Daemon which continues running in the background even after your build is finished.

You can add the following command to your before_script section to disable the daemon:
export GRADLE_OPTS=-Dorg.gradle.daemon=false

For me this solved the exact issue you are describing.


Ah ha! That’s sorted it. Thanks very much, very helpful.


I have exactly the same issue using a node_js build… so no Gradle involved in this one! Build is here

My .travis.yml:

dist: xenial
osx_image: xcode10.1

language: node_js
node_js: "8"

    - ELECTRON_CACHE=$HOME/.cache/electron
    - ELECTRON_BUILDER_CACHE=$HOME/.cache/electron-builder

  - linux
  - osx
  - windows

  - node_modules
  - $HOME/.cache/electron
  - $HOME/.cache/electron-builder
  - $HOME/.npm/_prebuilds

  - curl -o- -L | bash -s -- --version 1.2.1
  - export PATH=$HOME/.yarn/bin:$PATH
  - node --version && yarn --version && python --version

  - yarn

  - yarn run sass

  - rm -rf $HOME/.cache/electron-builder/wine


see Timeout after build finished (and succeeded)


@AviVahl thanks that does enable the build to now complete on Windows. However the Windows build takes 20 minutes, where the Linux build takes 2 minutes. The build on Windows seems to stall for a very long period of time related to storing cached assets. Any ideas?


Yeah, the Windows builds are much slower for us as well. yarn install takes forever. Appears to disconnect/retry several times until it succeeds.


Same here for nodejs build. However the exit status is (0/1), it is not reported and ends after timeout. May be worth to report as seperate issue, will do in the next few days.