From mboxrd@z Thu Jan 1 00:00:00 1970 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=-3.2 required=3.0 tests=AWL,BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 A15DB21841 for ; Tue, 1 May 2018 11:04:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754765AbeEALEk (ORCPT ); Tue, 1 May 2018 07:04:40 -0400 Received: from mout.gmx.net ([212.227.17.22]:49133 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753856AbeEALEi (ORCPT ); Tue, 1 May 2018 07:04:38 -0400 Received: from [192.168.0.129] ([37.201.195.116]) by mail.gmx.com (mrgmx102 [212.227.17.168]) with ESMTPSA (Nemesis) id 0LjdS8-1ecCNq2Pc0-00bbf8; Tue, 01 May 2018 13:04:14 +0200 Date: Tue, 1 May 2018 13:04:14 +0200 (DST) From: Johannes Schindelin X-X-Sender: virtualbox@gitforwindows.org To: Johannes Sixt cc: git@vger.kernel.org, Junio C Hamano , Jeff King Subject: Re: [PATCH 2/6] t1406: prepare for the refs code to fail with BUG() In-Reply-To: <7087f0b9-1362-f8ca-315d-96d27b91b26b@kdbg.org> Message-ID: References: <9bbfd73a8e03a888a5e9e8800d853ece518a8bf5.1525040253.git.johannes.schindelin@gmx.de> <7087f0b9-1362-f8ca-315d-96d27b91b26b@kdbg.org> User-Agent: Alpine 2.21.1 (DEB 209 2017-03-23) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Provags-ID: V03:K1:U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t Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Hi Hannes, On Mon, 30 Apr 2018, Johannes Sixt wrote: > Am 30.04.2018 um 00:17 schrieb Johannes Schindelin: > > t1406 specifically verifies that certain code paths fail with a BUG: ... > > message. > > > > In the upcoming commit, we will convert that message to be generated via > > BUG() instead of die("BUG: ..."), which implies SIGABRT instead of a > > regular exit code. > > > > [...] > > > > test_expect_success 'create-reflog() not allowed' ' > > - test_must_fail $RUN create-reflog HEAD 1 > > + test_must_fail ok=sigabrt $RUN create-reflog HEAD 1 > > ' > > I can't quite follow the rationale for this change. A 'BUG' error exit must > never be reached, otherwise it is a bug in the program by definition. It > cannot be OK that SIGABRT is a valid result from Git. I thought so at first, too. However, what these test cases run is not Git itself. Instead, they run a t/helper/ command *specifically* designed to hit the BUG code path, probably to ensure that bugs in future code will actually not be silently ignored, but do exit with an error. > If SIGABRT occurs as a result of BUG(), and we know that this happens for > certain cases, it means we have an unfixed bug. Not in this case: The code in question is in https://github.com/git/git/blob/v2.17.0/t/helper/test-ref-store.c#L190-L201 and it is called in a way that fails to have the required flags for the operation. This would normally indicate a bug, but in this case, that is exactly what the regression test tries to trigger: we *want* such a bug to cause a failure. I'll do my best to clarify that in the commit message. Ciao, Dscho