Skip to content

Commit b19aef3

Browse files
authored
[travis] also timeout tests (#6747)
1 parent a213fad commit b19aef3

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
@@ -68,7 +68,7 @@ echo "travis_fold:end:cmake"
6868
# uploading and subtract the bootstrapping time from that.
6969
# Hopefully clocks are in sync :)
7070
TRAVIS_TIME=90
71-
UPLOAD_TIME=8
71+
UPLOAD_TIME=5
7272
CURRENT_TIME=`date +%s`
7373
TIMEOUT=$(expr \( ${TRAVIS_TIME} - ${UPLOAD_TIME} \) \* 60 - ${CURRENT_TIME} + ${TRAVIS_TIMESTAMP})
7474
TIMEOUT=$(( ${TIMEOUT} < 300 ? 300 : ${TIMEOUT} ))
@@ -106,7 +106,15 @@ popd > /dev/null # /root/QGIS
106106
###########
107107
# Run tests
108108
###########
109-
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
109+
CURRENT_TIME=`date +%s`
110+
TIMEOUT=$(expr \( ${TRAVIS_TIME} - ${UPLOAD_TIME} \) \* 60 - ${CURRENT_TIME} + ${TRAVIS_TIMESTAMP})
111+
echo "Timeout: ${TIMEOUT}s (started at ${TRAVIS_TIMESTAMP}, current: ${CURRENT_TIME})"
112+
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
113+
rv=$?
114+
if [ $rv -eq 124 ] ; then
115+
printf '\n\n${bold}Build and test timeout. Please restart the build for meaningful results.${endbold}\n'
116+
exit #$rv
117+
fi
110118

111119
########################
112120
# Show ccache statistics

0 commit comments

Comments
 (0)