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: Building a Julia Project - Travis CI

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:)

2 Likes

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)';
3 Likes

Nice. What’s in ./docs/travis.sh?

Thanks,

…does it, though? Does it really, though?

No, no, I don’t think it does.

As far as I can tell, travis_wait doesn’t work with Julia at all. I’ve been mucking with this idiotically self-incompatible (and nearly undocumented) command all day. There seems to be no syntax that magically “tells” Travis to not timeout.

It’s possible that I missed something, but, I’m being objective here, the documentation for travis_wait is utter crap and there is no full working example of it on travis-ci, so who knows.

I’m guessing that invoking julia -e always spawns a child process, leading to a timeout. At the moment it appears that I can’t run tests that take >10 minutes total execution time on Arm64; an intractable problem in my case, since testing my web request functions alone takes that long.

You can hack around this by emitting some dummy echos, see for example https://github.com/thofma/Hecke.jl/blob/master/.travis.yml

2 Likes

It did work for me.

https://github.com/Balinus/ClimateTools.jl/blob/master/.travis.yml

1 Like

I don’t suppose either of you got travis_wait to work on arm64…? (is this even possible?)

When I try, this happens: Travis CI - Test and Deploy with Confidence

Above, I edited .travis.yml to force some output to stdout with julia -e 'println("arch = ", Sys.ARCH)' in my before_script: section. That does work, so that isn’t the issue.

I also split the usual test commands between before_script: and script:

Yet, notice what happens immediately after. The relevant lines in before_script: are:

- if [[ -a .git/shallow ]]; then git fetch; fi
- travis_wait 50 julia -e 'using Pkg; Pkg.build();'

The screen output doesn’t echo both commands, and acts like travis_wait isn’t being invoked:

$ if [[ -a

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: Common Build Problems - Travis CI

The build has been terminated

The dummy echo trick doesn’t seem to work with arm64, by the way.