Re: [PATCH v8 00/11] Git filter protocol
- From
Torsten Bögershausen <tboegi@web.de>
- Date
- Sep 29, 2016, 11:57 UTC
- Message-ID
- <f7a4f828-bb1d-0ffa-e369-3b4fa476d9e5@web.de>
- In-Reply-To
- <C2C9761E-986F-473D-BFB7-CBEF900D9FA3@gmail.com>
On 29/09/16 12:28, Lars Schneider wrote:
Show 36 quoted lines
>> On 28 Sep 2016, at 23:49, Junio C Hamano <gitster@pobox.com> wrote:
>>
>> I suspect that you are preparing a reroll already, but the one that
>> is sitting in 'pu' seems to be flaky in t/t0021 and I seem to see
>> occasional failures from it.
>>
>> I didn't trace where the test goes wrong, but one easy mistake you
>> could make (I am not saying that is the reason of the failure) is to
>> assume your filter will not be called under certain condition (like
>> immediately after you checked out from the index to the working
>> tree), when the automated test goes fast enough and get you into a
>> "racy git" situation---the filter may be asked to filter the
>> contents from the working tree again to re-validate what's there is
>> still what is in the index.
> Thanks for the heads-up!
>
> This is what happens:
>
> 1) Git exits
> 2) The filter process receives EOF and prints "STOP" to the log
> 3) t0021 checks the content of the log
>
> Sometimes 3 happened before 2 which makes the test fail.
> (Example: https://travis-ci.org/git/git/jobs/162660563 )
>
> I added a this to wait until the filter process terminates:
>
> +wait_for_filter_termination () {
> + while ps | grep -v grep | grep -F "/t0021/rot13-filter.pl" >/dev/null 2>&1
> + do
> + echo "Waiting for /t0021/rot13-filter.pl to finish..."
> + sleep 1
> + done
> +}
>
> Does this look OK to you?Do we need the ps at all ? How about this:
+wait_for_filter_termination () { + while ! grep "STOP" LOGFILENAME >/dev/null + do + echo "Waiting for /t0021/rot13-filter.pl to finish..." + sleep 1 + done +}