summaryrefslogtreecommitdiff
path: root/tests/misc/sort-spinlock-abuse
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2011-06-13 11:05:49 +0200
committerJim Meyering <meyering@redhat.com>2011-06-13 12:39:22 +0200
commitcd94370f744ec13178726499797ede0b13385521 (patch)
treed2fe917a945243b6dbdc37f4aba4ddd8163a936b /tests/misc/sort-spinlock-abuse
parent5a3879ad03ff926e504b48694d8e589089154369 (diff)
downloadcoreutils-cd94370f744ec13178726499797ede0b13385521.tar.xz
tests: avoid sort-spinlock-abuse false positive under heavy load
* tests/misc/sort-spinlock-abuse: This test would frequently fail when run on a system under heavy load. Increase duration and limit.
Diffstat (limited to 'tests/misc/sort-spinlock-abuse')
-rwxr-xr-xtests/misc/sort-spinlock-abuse9
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/misc/sort-spinlock-abuse b/tests/misc/sort-spinlock-abuse
index b5ca30ff5..fc9612cfc 100755
--- a/tests/misc/sort-spinlock-abuse
+++ b/tests/misc/sort-spinlock-abuse
@@ -26,13 +26,14 @@ grep '^#define HAVE_PTHREAD_T 1' "$CONFIG_HEADER" > /dev/null ||
seq 100000 > in || framework_failure_
mkfifo_or_skip_ fifo
-# Arrange for sort to require 5.0+ seconds of wall-clock time,
+# Arrange for sort to require 8.0+ seconds of wall-clock time,
# while actually using far less than 1 second of CPU time.
-(for i in $(seq 50); do read line; echo $i; sleep .1; done
+(for i in $(seq 80); do read line; echo $i; sleep .1; done
cat > /dev/null) < fifo &
-# Limit CPU time to 1 second
-ulimit -t 1
+# However, under heavy load, it can easily take more than
+# one second of CPU time, so set a permissive limit:
+ulimit -t 7
sort --parallel=2 in > fifo || fail=1
Exit $fail