git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] t/lib-git-daemon: fix signal checking

From
Jeff King <peff@peff.net>
Date
Dec 4, 2018, 06:34 UTC
Message-ID
<20181204063402.GA10178@sigill.intra.peff.net>
In-Reply-To
<20181126200337.32462-1-szeder.dev@gmail.com>
On Mon, Nov 26, 2018 at 09:03:37PM +0100, SZEDER Gábor wrote:
Show 18 quoted lines
> Test scripts checking 'git daemon' stop the daemon with a TERM signal,
> and the 'stop_git_daemon' helper checks the daemon's exit status to
> make sure that it indeed died because of that signal.
> 
> This check is bogus since 03c39b3458 (t/lib-git-daemon: use
> test_match_signal, 2016-06-24), for two reasons:
> 
>   - Right after killing 'git daemon', 'stop_git_daemon' saves its exit
>     status in a variable, but since 03c39b3458 the condition checking
>     the exit status looks at '$?', which at this point is not the exit
>     status of 'git daemon', but that of the variable assignment, i.e.
>     it's always 0.
> 
>   - The unexpected exit status should abort the whole test script with
>     'error', but it doesn't, because 03c39b3458 forgot to negate
>     'test_match_signal's exit status in the condition.
> 
> This patch fixes both issues.
Oof. Who says two wrongs don't make a right? :)
Thanks for catching this, and the patch looks obviously correct.

I peeked at the other test_match_signal conversions from that era, and they all look sane.

-Peff
Previous: SZEDER Gábor
Message 2 of 2 in “t/lib-git-daemon: fix signal checking”
  1. t/lib-git-daemon: fix signal checkingSZEDER Gábor, Nov 26, 2018
  2. Jeff KingDec 4, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.