summaryrefslogtreecommitdiff
path: root/tests/rm
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2009-02-27 12:54:01 +0100
committerJim Meyering <meyering@redhat.com>2009-03-02 09:35:12 +0100
commit2b1e6636beab4d16ade9685175568d12bafeee9d (patch)
tree0a123fac8a33d0c099b8e9bb7459254ba75996ed /tests/rm
parent8c4f28b1242badb046f1a65942314420637d5cb7 (diff)
downloadcoreutils-2b1e6636beab4d16ade9685175568d12bafeee9d.tar.xz
tests: rm/ext3-perf: relax this test
* tests/rm/ext3-perf: If set-up takes too long, use the set-up time as the removal time limit. Otherwise, a parallel "make check" would usually fail when run with RUN_VERY_EXPENSIVE_TESTS=yes.
Diffstat (limited to 'tests/rm')
-rwxr-xr-xtests/rm/ext3-perf7
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/rm/ext3-perf b/tests/rm/ext3-perf
index b6467efe3..6ca87a067 100755
--- a/tests/rm/ext3-perf
+++ b/tests/rm/ext3-perf
@@ -1,7 +1,7 @@
#!/bin/sh
# ensure that "rm -rf DIR-with-many-entries" is not O(N^2)
-# Copyright (C) 2008 Free Software Foundation, Inc.
+# Copyright (C) 2008-2009 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -67,6 +67,11 @@ test $ok = 1 || framework_failure
setup_duration=$(expr $(date +%s) - $start)
echo creating a $n-entry directory took $setup_duration seconds
+# If set-up took longer than the default $threshold_seconds,
+# use the longer set-up duration as the limit.
+test $threshold_seconds -lt $setup_duration \
+ threshold_seconds=$setup_duration
+
fail=0
start=$(date +%s)
timeout ${threshold_seconds}s rm -rf d; err=$?