summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2015-10-10 03:59:53 +0100
committerPádraig Brady <P@draigBrady.com>2015-10-10 11:21:34 +0100
commit934940b561fbf6d1adff862c6294968fc7e55e8c (patch)
tree3ab5e83848ef9a3e9565c141d0d126ac65874a45 /tests
parentc1dba59a79249f8e9f546fd3453da32a17ccaeb1 (diff)
downloadcoreutils-934940b561fbf6d1adff862c6294968fc7e55e8c.tar.xz
tests: make a long running test responsive to Ctrl-C
* tests/misc/sort-compress-hang.sh: Use --foreground with the timeout(1) command (noting the caveats), to run the sort command in the foreground program group, and thus be responsive to Ctrl-C. This very_expensive_ test takes over a minute on a i3-2310M, with RAM backed /tmp.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/misc/sort-compress-hang.sh6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/misc/sort-compress-hang.sh b/tests/misc/sort-compress-hang.sh
index dc101fea8..1d13cbfae 100755
--- a/tests/misc/sort-compress-hang.sh
+++ b/tests/misc/sort-compress-hang.sh
@@ -35,7 +35,11 @@ tac exp > in || fail=1
# 'sort' could be running slowly on an overburdened machine.
# On a circa-2010 Linux server using NFS, a successful test completes
# in about 170 seconds, so specify 1700 seconds as a safety margin.
-timeout 1700 sort --compress-program=./compress -S 1k in > out || fail=1
+# Note --foreground will not kill any of the "compress" sub processes,
+# assuming they're well behaved and exit in a timely manner, but will
+# allow this command to be responsive to Ctrl-C
+timeout --foreground 1700 sort --compress-program=./compress -S 1k in > out \
+ || fail=1
compare exp out || fail=1
test -f ok || fail=1