travis builds are getting more expensive, as the executables are built with more instrumentation (memory-, or address-sanitizers, ...) and the number of functional tests increases. Thus, a vanilla build (without depends cache and compile cache) would time out. Since depends is only touched rarely, a workaround was to quit travis early in case of a vanilla build, store the cache and mark the build as failed. The next run would take the cache and continue from there. C.f. https://github.com/bitcoin/bitcoin/blob/2945492424934fa360f86b116184ee8e34f19d0a/.travis.yml#L35
I tried to do the same for the regular compilation of Bitcoin Core, but it would run into issues in the mac build: https://travis-ci.org/bitcoin/bitcoin/builds/490661548
To solve my oversight, someone could set a flag to not run any later scripts after the first one timed out.
However, I am creating this issue to see if anyone has other ideas to solve the issue more cleanly.