Skip to content

Commit 2cae2f4

Browse files
committedApr 4, 2018
[travis] also timeout tests (#6747)
1 parent 634274e commit 2cae2f4

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed
 

‎.ci/travis/linux/docker-build-test.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ echo "travis_fold:end:cmake"
6767
# uploading and subtract the bootstrapping time from that.
6868
# Hopefully clocks are in sync :)
6969
TRAVIS_TIME=90
70-
UPLOAD_TIME=8
70+
UPLOAD_TIME=5
7171
CURRENT_TIME=`date +%s`
7272
TIMEOUT=$(expr \( ${TRAVIS_TIME} - ${UPLOAD_TIME} \) \* 60 - ${CURRENT_TIME} + ${TRAVIS_TIMESTAMP})
7373
TIMEOUT=$(( ${TIMEOUT} < 300 ? 300 : ${TIMEOUT} ))
@@ -105,7 +105,15 @@ popd > /dev/null # /root/QGIS
105105
###########
106106
# Run tests
107107
###########
108-
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
108+
CURRENT_TIME=`date +%s`
109+
TIMEOUT=$(expr \( ${TRAVIS_TIME} - ${UPLOAD_TIME} \) \* 60 - ${CURRENT_TIME} + ${TRAVIS_TIMESTAMP})
110+
echo "Timeout: ${TIMEOUT}s (started at ${TRAVIS_TIMESTAMP}, current: ${CURRENT_TIME})"
111+
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
112+
rv=$?
113+
if [ $rv -eq 124 ] ; then
114+
printf '\n\n${bold}Build and test timeout. Please restart the build for meaningful results.${endbold}\n'
115+
exit #$rv
116+
fi
109117

110118
########################
111119
# Show ccache statistics

0 commit comments

Comments
 (0)
Please sign in to comment.