Skip to content

Commit

Permalink
[travis] also timeout tests (#6747)
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids authored Apr 4, 2018
1 parent a213fad commit b19aef3
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions .ci/travis/linux/docker-build-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ echo "travis_fold:end:cmake"
# uploading and subtract the bootstrapping time from that.
# Hopefully clocks are in sync :)
TRAVIS_TIME=90
UPLOAD_TIME=8
UPLOAD_TIME=5
CURRENT_TIME=`date +%s`
TIMEOUT=$(expr \( ${TRAVIS_TIME} - ${UPLOAD_TIME} \) \* 60 - ${CURRENT_TIME} + ${TRAVIS_TIMESTAMP})
TIMEOUT=$(( ${TIMEOUT} < 300 ? 300 : ${TIMEOUT} ))
Expand Down Expand Up @@ -106,7 +106,15 @@ popd > /dev/null # /root/QGIS
###########
# Run tests
###########
python3 /root/QGIS/.ci/travis/scripts/ctest2travis.py xvfb-run ctest -V -E "$(cat /root/QGIS/.ci/travis/linux/blacklist.txt | sed -r '/^(#.*?)?$/d' | paste -sd '|' -)" -S /root/QGIS/.ci/travis/travis.ctest --output-on-failure
CURRENT_TIME=`date +%s`
TIMEOUT=$(expr \( ${TRAVIS_TIME} - ${UPLOAD_TIME} \) \* 60 - ${CURRENT_TIME} + ${TRAVIS_TIMESTAMP})
echo "Timeout: ${TIMEOUT}s (started at ${TRAVIS_TIMESTAMP}, current: ${CURRENT_TIME})"
timeout ${TIMEOUT}s python3 /root/QGIS/.ci/travis/scripts/ctest2travis.py xvfb-run ctest -V -E "$(cat /root/QGIS/.ci/travis/linux/blacklist.txt | sed -r '/^(#.*?)?$/d' | paste -sd '|' -)" -S /root/QGIS/.ci/travis/travis.ctest --output-on-failure
rv=$?
if [ $rv -eq 124 ] ; then
printf '\n\n${bold}Build and test timeout. Please restart the build for meaningful results.${endbold}\n'
exit #$rv
fi

########################
# Show ccache statistics
Expand Down

0 comments on commit b19aef3

Please sign in to comment.