summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJim Meyering <meyering@fb.com>2016-09-22 22:48:46 -0700
committerJim Meyering <meyering@fb.com>2016-09-23 11:33:54 -0700
commit72aa3b232e847e8ab78093e87dc1ee6471d192ac (patch)
tree103bc2dc97da5541fafb28cf70ebc49c7d28ccb1 /tests
parent4a86a5e728ae0152048dd9a65d681f324c8aea17 (diff)
downloadgrep-72aa3b232e847e8ab78093e87dc1ee6471d192ac.tar.gz
tests: avoid backref-multibyte-slow false failure
* tests/backref-multibyte-slow (max_seconds): If we calculate a max duration of 1 second, use 5. Otherwise, on high-latency systems, it would be way too easy for the duration of the final test run to exceed that limit. Reported by Nelson H. F. Beebe. http://bugs.gnu.org/24516
Diffstat (limited to 'tests')
-rwxr-xr-xtests/backref-multibyte-slow4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/backref-multibyte-slow b/tests/backref-multibyte-slow
index 05bb62e1..fb012a6d 100755
--- a/tests/backref-multibyte-slow
+++ b/tests/backref-multibyte-slow
@@ -19,6 +19,10 @@ max_seconds=$(LC_ALL=C perl -le 'use Time::HiRes qw(time); my $s = time();
|| { max_seconds=5;
warn_ "$ME_: warning: no perl? using default of 5s timeout"; }
+# If the above finished so quickly that we'd have a 1-second timeout,
+# increase it to a duration less likely to arise in a parallel test run.
+test $max_seconds = 1 && max_seconds=5
+
for LOC in en_US.UTF-8; do
out=out-$LOC
LC_ALL=$LOC timeout ${max_seconds}s grep -aE '^([a-z]).\1$' in > $out 2>&1