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 committed Apr 4, 2018
1 parent 634274e commit 2cae2f4
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions .ci/travis/linux/docker-build-test.sh
Expand Up @@ -67,7 +67,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 @@ -105,7 +105,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 2cae2f4

Please sign in to comment.