diff options
author | Jim Meyering <meyering@fb.com> | 2016-08-05 21:38:30 -0700 |
---|---|---|
committer | Jim Meyering <meyering@fb.com> | 2016-08-06 09:24:09 -0700 |
commit | a2a3df953a91f898bd94f05a26088ccdc351fb3a (patch) | |
tree | 60c726df3e20a8601ad9bee349e6b009b61eccb8 /tests/backref-multibyte-slow | |
parent | 61e0661e1b086c8933197f498139db26f157b713 (diff) | |
download | grep-a2a3df953a91f898bd94f05a26088ccdc351fb3a.tar.gz |
tests/backref-multibyte-slow:: avoid false positive
* tests/backref-multibyte-slow: When redirecting the "fast" LC_ALL=C
run's output to /dev/null, we got an artificially low timing (of 0),
due to grep's own stdout-vs-/dev/null optimization. With an initial
timing of 0 on that first run, the derived timeout for the UTF-8 run
(which redirects to a file) would be a mere 1 second. The fix: also
redirect that first run's output to a file, not to /dev/null.
Diffstat (limited to 'tests/backref-multibyte-slow')
-rwxr-xr-x | tests/backref-multibyte-slow | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/backref-multibyte-slow b/tests/backref-multibyte-slow index d447a4a9..05bb62e1 100755 --- a/tests/backref-multibyte-slow +++ b/tests/backref-multibyte-slow @@ -14,7 +14,7 @@ $AWK 'BEGIN {for (i=0; i<13000; i++) print "aba"}' /dev/null > in || fail=1 # when running in en_US.UTF-8. Round up to whole seconds, since timeout # can't deal with fractional seconds. max_seconds=$(LC_ALL=C perl -le 'use Time::HiRes qw(time); my $s = time(); - system q,grep -E '\''^([a-z]).\1$'\'' in > /dev/null,; + system q,grep -E '\''^([a-z]).\1$'\'' in > junk,; my $elapsed = time() - $s; print int (1 + 10 * $elapsed)') \ || { max_seconds=5; warn_ "$ME_: warning: no perl? using default of 5s timeout"; } |