Testing on travis with >10min initial compile time

My tests are starting to fail due to initial compile time:

$ julia --check-bounds=yes --color=yes -e "if VERSION < v\"0.7.0-DEV.5183\"; Pkg.test(\"${JL_PKG}\", coverage=true); else using Pkg; Pkg.test(coverage=true); end"
   Testing ApproxFun
 Resolving package versions...
No output has been received in the last 10m0s, this potentially indicates a stalled build or something wrong with the build itself.
Check the details on how to adjust your build configuration on: https://docs.travis-ci.com/user/common-build-problems/#Build-times-out-because-no-output-was-received

I’ve looked at the suggested fix which is to use travis_wait, but I’m unsure how to incorporate this into my .travis.yml file. Any suggestions?

I think its just prefixed in front of the relevant command (e.g. to permit a 20 minute timeout):

travis_wait 20 julia --check-bounds=yes --color=yes -e "if VERSION < v\"0.7.0-DEV.5183\"; Pkg.test(\"${JL_PKG}\", coverage=true); else using Pkg; Pkg.test(coverage=true); end"

I’ve used a variation of this reading R packages, but no experience with Julia, but I’d be surprised if it differed.

But there is no “command” in my .travis.yml:

# Documentation: http://docs.travis-ci.com/user/languages/julia/
language: julia
os:
  - linux
  - osx
julia:
  - "1.0"
  - "1.1"
  - "1.2"
  - nightly
matrix:
  allow_failures:
    - julia: nightly
notifications:
  email: false
codecov: true

If you don’t specify build and/or script in your .travis.yml file, then Travis will use the default build and test scripts for the specified language.

The defaults for Julia are available here: https://docs.travis-ci.com/user/languages/julia/#default-build-and-test-script

A low-cost workaround is to print something occasionally, eg with @info.

How do you do that if it’s during using time?

You could break up the using statements to single ones (I assume we are talking about this code), then emit @infos.

(Changing the Travis timeout is more elegant, this is the cheapo solution. :wink:)

1 Like

An easy and quick fix is to do something similar to Suggestion: forcing Travis CI to render verbose build output. Just replace the tail call with an echo statement, e.g., “while sleep 30; do echo “still alive”; done &”

This works:

# Documentation: http://docs.travis-ci.com/user/languages/julia/
language: julia
os:
  - linux
  - osx
julia:
  - "1.0"
  - "1.1"
  - "1.2"
  - nightly
matrix:
  allow_failures:
    - julia: nightly
    - os: osx
notifications:
  email: false
after_script:
  - bash ./docs/travis.sh
codecov: true


# uncomment the following lines to override the default test script
script:
  - if [[ -a .git/shallow ]]; then git fetch --unshallow; fi
  - travis_wait 20 julia --project -e 'using Pkg; Pkg.build(); Pkg.test(; coverage=true)';
1 Like