Navigation Menu

Skip to content

Commit

Permalink
Calculate travis timeout dynamically
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Apr 26, 2017
1 parent 23cb825 commit b407428
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 2 additions & 0 deletions ci/travis/macos/before_install.sh
Expand Up @@ -13,6 +13,8 @@
# #
###########################################################################

echo `date +%s` > /tmp/travis_timestamp

brew tap osgeo/osgeo4mac
brew update
brew install python3
Expand Down
13 changes: 7 additions & 6 deletions ci/travis/macos/script.sh
Expand Up @@ -21,13 +21,14 @@ export PATH=/usr/bin:${PATH}
ccache -s
ccache -M 1G

# Allow a maximum of 25 minutes for the tests to run in order to timeout before
# travis does and in order to have some time left to upload the ccache to have
# a chance to finish a rebuild in time.
# Calculate the timeout for the tests.
# The tests should be aborted before travis times out, in order to allow uploading
# the ccache and therefore speedup subsequent e builds.
#
# Travis will kill the job after approx 48 minutes, so this leaves us 23 minutes
# for setup and cache uploading
gtimeout 25m ctest -V -E "$(cat ${DIR}/blacklist.txt | gsed -r '/^(#.*?)?$/d' | gpaste -sd '|' -)" -S ${DIR}/travis.ctest --output-on-failure
# Travis will kill the job after approx 48 minutes, we subtract 8 minutes for
# uploading and initialization (40) and subtract the bootstrapping time from that.
TIMEOUT=$(expr 40 \* 60 - `date +%s` + `cat /tmp/travis_timestamp`)
gtimeout ${TIMEOUT}s ctest -V -E "$(cat ${DIR}/blacklist.txt | gsed -r '/^(#.*?)?$/d' | gpaste -sd '|' -)" -S ${DIR}/travis.ctest --output-on-failure

rv=$?

Expand Down

0 comments on commit b407428

Please sign in to comment.