How to increase Travis CI timeout?
There are different use cases where Travis jobs could raise the timeout error. Maybe you are trying to install a Python module that takes some time before installing the dependencies e.g:
1
2
3
4
5
install:
pip install torch
or you are running the Java project tests e.g
1
2
3
4
5
script:
mvn package -Dtestng=test.xml
or pushing a new image to the Docker registry e.g
1
2
3
4
5
script:
docker push $APPLICATION:$IMAGE_VERSION;
The default Travis job timeout is set to 10 min, so in some scenarios the above commands will fail with:
1
2
3
Timeout (20 minutes) reached. Terminating "..."
To increase the timeouts
travis ci offers a function that will increase the build timeouts:
1
2
3
install: travis_wait N mvn install
The travis_wait n
where the n
is the minutes by which the waiting time is increased.
Note: You must carefully use
travis_wait
since it can extend the build time when there could happen another issue.