]> granicus.if.org Git - strace/commitdiff
tests: enhance timeout diagnostics
authorDmitry V. Levin <ldv@altlinux.org>
Wed, 19 Jul 2017 02:38:37 +0000 (02:38 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Wed, 19 Jul 2017 02:38:37 +0000 (02:38 +0000)
* 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.

tests/init.sh
tests/run.sh

index 2d4d0b41c3cf27a4d630e93eced545dd08f61864..4ef8dd7a874a4011dc77cb7d4d5c7c886d78a88d 100644 (file)
@@ -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
index 02d99123c4ab0855e13598d9759addf60559811d..d1b796ca5fa80211f090bfdb312c6e47729e399f 100755 (executable)
@@ -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=