From: Dmitry V. Levin Date: Wed, 19 Jul 2017 02:38:37 +0000 (+0000) Subject: tests: enhance timeout diagnostics X-Git-Tag: v4.19~247 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=741dadd12d178446865a8ba03a2864834926deab;p=strace tests: enhance timeout diagnostics * tests/init.sh: Trap SIGXCPU. * tests/run.sh: Send SIGXCPU instead of SIGKILL in case of timeout, send SIGKILL if the command is still running 5 seconds after SIGXCPU. --- diff --git a/tests/init.sh b/tests/init.sh index 2d4d0b41..4ef8dd7a 100644 --- a/tests/init.sh +++ b/tests/init.sh @@ -361,6 +361,8 @@ if [ -n "$NAME" ]; then ;; esac } + + trap 'dump_log_and_fail_with "time limit ($TIMEOUT_DURATION) exceeded"' XCPU else [ -n "${STRACE-}" ] || STRACE=../strace diff --git a/tests/run.sh b/tests/run.sh index 02d99123..d1b796ca 100755 --- a/tests/run.sh +++ b/tests/run.sh @@ -5,7 +5,7 @@ $STRACE -V > /dev/null || framework_failure_ "$STRACE is not available" -TIMEOUT="timeout -s 9 $TIMEOUT_DURATION" +TIMEOUT="timeout -k 5 -s XCPU $TIMEOUT_DURATION" $TIMEOUT true > /dev/null 2>&1 || TIMEOUT=