From be6b4218e47e27c591f589f27f543079d7930dce Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sun, 30 Nov 2008 18:43:55 +0100 Subject: tests: dd/reblock: avoid occasional failure * tests/dd/reblock: Sleep longer to avoid a race condition. Reported by Bob Proulx. --- tests/dd/reblock | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/dd/reblock b/tests/dd/reblock index 542529a71..ef9e03613 100755 --- a/tests/dd/reblock +++ b/tests/dd/reblock @@ -44,7 +44,10 @@ sed 's/,.*//' err > k && mv k err compare err exp-reblock || fail=1 # Demonstrate that bs=N supersedes even following ibs= and obs= settings. -(echo x; sleep .1; echo y) | dd bs=3 ibs=1 obs=1 > out 2> err || fail=1 +# Choosing a delay of 0.1 would result in an occasional lost race where +# the consumer's first read would consume 3 bytes rather than the expected 2. +# Not wanting to sleep a full second, I'll raise that to 0.3. +(printf ab; sleep .3; printf cd) | dd bs=3 ibs=1 obs=1 > out 2> err || fail=1 sed 's/,.*//' err > k && mv k err compare err exp-no-reblock || fail=1 -- cgit v1.2.3-70-g09d2