[prev in list] [next in list] [prev in thread] [next in thread]
List: coreutils
Subject: Re: [PATCH] tests: fix races wrt output files of background processes
From: Bernhard Voelker <mail () bernhard-voelker ! de>
Date: 2016-01-10 12:56:53
Message-ID: 56925515.9050800 () bernhard-voelker ! de
[Download RAW message or body]
On 01/10/2016 01:28 PM, Pádraig Brady wrote:
> 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.
I also checked other places found by
git grep -C20 '>.* & pid=' -- tests
but most of them don't use a loop or otherwise don't use the same output
file in consecutive test statements. So I hope we got them all now.
> +1 to complete patch.
Thanks for the review - pushed.
Have a nice day,
Berny
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic