# Testing on travis with \>10min initial compile time

**URL:** https://discourse.julialang.org/t/testing-on-travis-with-10min-initial-compile-time/26721
**Category:** Tooling
**Tags:** travis
**Created:** [July 24, 2019, 7:47am UTC](https://discourse.julialang.org/t/testing-on-travis-with-10min-initial-compile-time/26721 "2019-07-24T07:47:06Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![dlfivefifty](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dlfivefifty/32/1959_2.png) [@dlfivefifty](https://discourse.julialang.org/u/dlfivefifty)
#### Post date: [July 24, 2019, 7:47am UTC](https://discourse.julialang.org/t/testing-on-travis-with-10min-initial-compile-time/26721/1 "2019-07-24T07:47:06Z")

</div>

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

```julia
$ 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?

---

<div class="post-metadata">

### Author: ![angusmoore](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/angusmoore/32/5654_2.png) [@angusmoore](https://discourse.julialang.org/u/angusmoore)
#### Post date: [July 24, 2019, 8:03am UTC](https://discourse.julialang.org/t/testing-on-travis-with-10min-initial-compile-time/26721/2 "2019-07-24T08:03:54Z")

</div>

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

```julia
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.

---

<div class="post-metadata">

### Author: ![dlfivefifty](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dlfivefifty/32/1959_2.png) [@dlfivefifty](https://discourse.julialang.org/u/dlfivefifty)
#### Post date: [July 24, 2019, 8:05am UTC](https://discourse.julialang.org/t/testing-on-travis-with-10min-initial-compile-time/26721/3 "2019-07-24T08:05:32Z")

</div>

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

```julia
# 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

```

---

<div class="post-metadata">

### Author: ![dilumaluthge](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dilumaluthge/32/29283_2.png) [@dilumaluthge](https://discourse.julialang.org/u/dilumaluthge)
#### Post date: [July 24, 2019, 8:07am UTC](https://discourse.julialang.org/t/testing-on-travis-with-10min-initial-compile-time/26721/4 "2019-07-24T08:07:46Z")

</div>

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](https://docs.travis-ci.com/user/languages/julia/#default-build-and-test-script)

---

<div class="post-metadata">

### Author: ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)
#### Post date: [July 24, 2019, 8:35am UTC](https://discourse.julialang.org/t/testing-on-travis-with-10min-initial-compile-time/26721/5 "2019-07-24T08:35:35Z")

</div>

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

---

<div class="post-metadata">

### Author: ![dlfivefifty](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dlfivefifty/32/1959_2.png) [@dlfivefifty](https://discourse.julialang.org/u/dlfivefifty)
#### Post date: [July 24, 2019, 9:26am UTC](https://discourse.julialang.org/t/testing-on-travis-with-10min-initial-compile-time/26721/6 "2019-07-24T09:26:34Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)
#### Post date: [July 24, 2019, 9:43am UTC](https://discourse.julialang.org/t/testing-on-travis-with-10min-initial-compile-time/26721/7 "2019-07-24T09:43:05Z")

</div>

You could break up the `using` statements to single ones (I assume we are talking about [this code](https://github.com/JuliaApproximation/ApproxFun.jl/blob/23be7800c40f6e6f20dcc9dcb2eabf57c011b385/test/runtests.jl#L1)), then emit `@info`s.

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

---

<div class="post-metadata">

### Author: ![thofma](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/thofma/32/1691_2.png) [@thofma](https://discourse.julialang.org/u/thofma)
#### Post date: [July 24, 2019, 1:36pm UTC](https://discourse.julialang.org/t/testing-on-travis-with-10min-initial-compile-time/26721/8 "2019-07-24T13:36:49Z")

</div>

An easy and quick fix is to do something similar to [Suggestion: forcing Travis CI to render verbose build output](https://discourse.julialang.org/t/suggestion-forcing-travis-ci-to-render-verbose-build-output/14716). Just replace the tail call with an echo statement, e.g., “while sleep 30; do echo “still alive”; done &”

---

<div class="post-metadata">

### Author: ![dlfivefifty](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dlfivefifty/32/1959_2.png) [@dlfivefifty](https://discourse.julialang.org/u/dlfivefifty)
#### Post date: [July 24, 2019, 7:59pm UTC](https://discourse.julialang.org/t/testing-on-travis-with-10min-initial-compile-time/26721/9 "2019-07-24T19:59:09Z")

</div>

This works:

```julia
# 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)';

```

---

<div class="post-metadata">

### Author: ![Tim\_Kelley](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tim_kelley/32/7399_2.png) [@Tim\_Kelley](https://discourse.julialang.org/u/Tim_Kelley)
#### Post date: [October 21, 2019, 2:09pm UTC](https://discourse.julialang.org/t/testing-on-travis-with-10min-initial-compile-time/26721/10 "2019-10-21T14:09:29Z")

</div>

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

Thanks,

---

<div class="post-metadata">

### Author: ![joshua\_jones](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/joshua_jones/32/7554_2.png) [@joshua\_jones](https://discourse.julialang.org/u/joshua_jones)
#### Post date: [December 13, 2019, 9:24am UTC](https://discourse.julialang.org/t/testing-on-travis-with-10min-initial-compile-time/26721/11 "2019-12-13T09:24:28Z")

</div>

> [@dlfivefifty](#):
>
> This works:
> 
> ```julia
> # 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)';
> 
> ```

…does it, though? Does it _really_, though?

> **[Travis CI - Test and Deploy with Confidence](https://app.travis-ci.com/jpjones76/SeisIO.jl/jobs/624526857)**
>
> Travis CI enables your team to test and ship your apps with confidence. Easily sync your projects with Travis CI and you'll be testing your code in minutes.

> **[Travis CI - Test and Deploy with Confidence](https://app.travis-ci.com/jpjones76/SeisIO.jl/jobs/624520062)**
>
> Travis CI enables your team to test and ship your apps with confidence. Easily sync your projects with Travis CI and you'll be testing your code in minutes.

> **[Travis CI - Test and Deploy with Confidence](https://app.travis-ci.com/jpjones76/SeisIO.jl/jobs/624485541)**
>
> Travis CI enables your team to test and ship your apps with confidence. Easily sync your projects with Travis CI and you'll be testing your code in minutes.

> **[Travis CI - Test and Deploy with Confidence](https://app.travis-ci.com/jpjones76/SeisIO.jl/jobs/624442441)**
>
> Travis CI enables your team to test and ship your apps with confidence. Easily sync your projects with Travis CI and you'll be testing your code in minutes.

> **[Travis CI - Test and Deploy with Confidence](https://app.travis-ci.com/jpjones76/SeisIO.jl/jobs/624480959)**
>
> Travis CI enables your team to test and ship your apps with confidence. Easily sync your projects with Travis CI and you'll be testing your code in minutes.

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.

---

<div class="post-metadata">

### Author: ![thofma](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/thofma/32/1691_2.png) [@thofma](https://discourse.julialang.org/u/thofma)
#### Post date: [December 13, 2019, 3:41pm UTC](https://discourse.julialang.org/t/testing-on-travis-with-10min-initial-compile-time/26721/12 "2019-12-13T15:41:38Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Balinus](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/balinus/32/243_2.png) [@Balinus](https://discourse.julialang.org/u/Balinus)
#### Post date: [December 13, 2019, 6:28pm UTC](https://discourse.julialang.org/t/testing-on-travis-with-10min-initial-compile-time/26721/13 "2019-12-13T18:28:35Z")

</div>

It did work for me.

[https://github.com/Balinus/ClimateTools.jl/blob/master/.travis.yml](https://github.com/Balinus/ClimateTools.jl/blob/master/.travis.yml)

---

<div class="post-metadata">

### Author: ![joshua\_jones](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/joshua_jones/32/7554_2.png) [@joshua\_jones](https://discourse.julialang.org/u/joshua_jones)
#### Post date: [December 14, 2019, 4:26am UTC](https://discourse.julialang.org/t/testing-on-travis-with-10min-initial-compile-time/26721/14 "2019-12-14T04:26:02Z")

</div>

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](https://travis-ci.org/jpjones76/SeisIO.jl/jobs/624898714)

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:

```julia
- 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](https://docs.travis-ci.com/user/common-build-problems/#build-times-out-because-no-output-was-received)
> 
> The build has been terminated

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