From d44ae88199ebf44fe721c06621a7ffc442fa34be Mon Sep 17 00:00:00 2001 From: Bernhard Voelker Date: Sun, 10 Jan 2016 01:44:04 +0100 Subject: 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. --- tests/tail-2/wait.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/tail-2/wait.sh') diff --git a/tests/tail-2/wait.sh b/tests/tail-2/wait.sh index bcb04858a..008f9f55e 100755 --- a/tests/tail-2/wait.sh +++ b/tests/tail-2/wait.sh @@ -72,7 +72,7 @@ if test "$HAVE_INOTIFY"; then { local delay="$1" - touch k || framework_failure_ + > k && > tail.out && > tail.err || framework_failure_ tail $fastpoll -F $mode k >tail.out 2>tail.err & pid=$! sleep $delay mv k l -- cgit v1.2.3-54-g00ecf