[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] tests: fix races wrt output files of background processes
From: |
Pádraig Brady |
Subject: |
Re: [PATCH] tests: fix races wrt output files of background processes |
Date: |
Sun, 10 Jan 2016 12:28:23 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 |
On 10/01/16 00:56, Bernhard Voelker wrote:
> 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.
Nice. Yes the fork (clone) happens before the open (O_TRUNC):
strace -f sh -c '/bin/true > out & pid=$!'
> * tests/dd/stats.sh: Likewise
> * tests/misc/cat-buf.sh: Likewise.
> * tests/misc/stdbuf.sh: Likewise.
No race for these 3 due to explicit `wait`,
but better to make the change for consistency.
> * tests/tail-2/wait.sh
Yes this was racy too.
+1 to complete patch.
thanks,
Pádraig.