summaryrefslogtreecommitdiff
path: root/tests/dd
diff options
context:
space:
mode:
authorBernhard Voelker <mail@bernhard-voelker.de>2016-01-10 01:44:04 +0100
committerBernhard Voelker <mail@bernhard-voelker.de>2016-01-10 01:51:27 +0100
commitd44ae88199ebf44fe721c06621a7ffc442fa34be (patch)
treeb4b9d5590a1889dcee548528881a7b6c82762461 /tests/dd
parent3d7b822e4a660e6804963d8e5ac0cdca2aeb3497 (diff)
downloadcoreutils-d44ae88199ebf44fe721c06621a7ffc442fa34be.tar.xz
tests: fix races wrt output files of background processes
At least the false positive in tail-2/follow-stdin.sh could be seen on a 4-core i5 system with -j8. Fix similar cases. too. * tests/tail-2/follow-stdin.sh: Empty the 'out' file in each iteration. Otherwise, under heavy system load, 'check_tail_output' would see the expected output from the previous round before tail would have the chance to come up in the background. While at it, move the creation of the 'exp' file out of the loop. * tests/dd/stats.sh: Empty the output file of the background process here, too. * tests/misc/cat-buf.sh: Likewise. * tests/misc/stdbuf.sh: Likewise. * tests/tail-2/wait.sh: Likewise.
Diffstat (limited to 'tests/dd')
-rwxr-xr-xtests/dd/stats.sh2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/dd/stats.sh b/tests/dd/stats.sh
index e8bb5fa27..182d5e7e7 100755
--- a/tests/dd/stats.sh
+++ b/tests/dd/stats.sh
@@ -38,6 +38,8 @@ cleanup_()
}
for open in '' '1'; do
+ > err || framework_failure_
+
# Run dd with the fullblock iflag to avoid short reads
# which can be triggered by reception of signals
dd iflag=fullblock if=/dev/zero of=fifo count=50 bs=5000000 2>err & pid=$!