Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-5.4 required=3.0 tests=AWL,BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by dcvr.yhbt.net (Postfix) with ESMTP id 2F93020986 for ; Thu, 29 Sep 2016 11:58:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755338AbcI2L6J (ORCPT ); Thu, 29 Sep 2016 07:58:09 -0400 Received: from mout.web.de ([217.72.192.78]:53294 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755041AbcI2L6H (ORCPT ); Thu, 29 Sep 2016 07:58:07 -0400 Received: from [192.168.209.54] ([195.252.60.88]) by smtp.web.de (mrweb101) with ESMTPSA (Nemesis) id 0MduAD-1bYu3c0TnB-00Pb4t; Thu, 29 Sep 2016 13:57:49 +0200 Subject: Re: [PATCH v8 00/11] Git filter protocol To: Lars Schneider , Junio C Hamano References: <20160920190247.82189-1-larsxschneider@gmail.com> Cc: git , Jeff King , Stefan Beller , =?UTF-8?Q?Jakub_Nar=c4=99bski?= , Martin-Louis Bright , ramsay@ramsayjones.plus.com From: =?UTF-8?Q?Torsten_B=c3=b6gershausen?= Message-ID: Date: Thu, 29 Sep 2016 13:57:47 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:jROvP4EsfMFFQo6R8hJz0RhDthEzJq2wEd4x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DYjGdq/5Q4JPgT61lenpLPrHQ12+fdhPXoUWIB+4VIroCxFSAi9l14S7yA iRFn4bKCp0XT1ExnRsag== Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On 29/09/16 12:28, Lars Schneider wrote: >> On 28 Sep 2016, at 23:49, Junio C Hamano 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 +}