summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2012-10-29 00:46:04 +0000
committerPádraig Brady <P@draigBrady.com>2012-11-24 15:43:08 +0000
commite83db8484ad92a68d39540a54ce0e022ee31f4ed (patch)
treee21d9c2b099fc56670090f714e0d4ba622612eec /tests
parent61d66690a5bb12a720383f10b1d9a1b8f840c726 (diff)
downloadcoreutils-e83db8484ad92a68d39540a54ce0e022ee31f4ed.tar.xz
tests: use sub-second timeouts to speed up a timeout test
* tests/misc/timeout.sh: Take advantage of recent support for sub-second timeouts to decrease runtime from about 6s to 2s.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/misc/timeout.sh8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/misc/timeout.sh b/tests/misc/timeout.sh
index 66d69566e..8db27c7b1 100755
--- a/tests/misc/timeout.sh
+++ b/tests/misc/timeout.sh
@@ -33,18 +33,18 @@ timeout 10 sh -c 'exit 2'
test $? = 2 || fail=1
# timeout
-timeout 1 sleep 10
+timeout .1 sleep 10
test $? = 124 || fail=1
# exit status propagation even on timeout
-timeout --preserve-status 1 sleep 10
+timeout --preserve-status .1 sleep 10
# exit status should be 128+TERM
test $? = 124 && fail=1
# kill delay. Note once the initial timeout triggers,
# the exit status will be 124 even if the command
# exits on its own accord.
-timeout -s0 -k1 1 sleep 10
+timeout -s0 -k1 .1 sleep 10
test $? = 124 && fail=1
# Ensure 'timeout' is immune to parent's SIGCHLD handler
@@ -57,7 +57,7 @@ test $? = 124 && fail=1
) || fail=1
# Don't be confused when starting off with a child (Bug#9098).
-out=$(sleep 1 & exec timeout 2 sh -c 'sleep 3; echo foo')
+out=$(sleep .1 & exec timeout .5 sh -c 'sleep 2; echo foo')
status=$?
test "$out" = "" && test $status = 124 || fail=1