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

Timing issue in t5570 "daemon log records all attributes"

From
Jan Palus <jpalus@fastmail.com>
Date
Apr 3, 2018, 19:33 UTC
Message-ID
<1522783990.964448.1325338528.0D49CC15@webmail.messagingengine.com>

My understanding of test "daemon log records all attributes" is that daemon process is started in background, some git command is executed and daemon's output (saved to daemon.log) is compared against expected value. However daemon.log is not a straight redirect to file -- it is being piped through fifo, read by a loop in test-git-daemon.sh, additional processing is performed and finally it makes it to daemon.log. All of this performed concurrently with test execution. My question is how do you exactly avoid timing issues here? grep on daemon.log is performed immediately after git invocation:

        >daemon.log &&
        GIT_OVERRIDE_VIRTUAL_HOST=localhost \
                git -c protocol.version=1 \
                        ls-remote "$GIT_DAEMON_URL/interp.git" &&
        grep -i extended.attribute daemon.log | cut -d" " -f2- >actual &&

how can you be sure grep operates on daemon.log that already includes all output and not on intermediate state that is just being processed by while loop? Same question applies to ">daemon.log" since shell might still be processing output of previous test and its content might possibly land in the file after zeroing.

The reason I'm asking is because /bin/sh in my distribution (mksh) actually manifests the issue -- test fails because at the time of grep output was not processed yet (fixed by sleep 1 before grep). Also there is an issue with output of previous test landing in daemon.log despite ">daemon.log".

Regards Jan

Next: Jeff King
Message 1 of 4 in “Timing issue in t5570 "daemon log records all attributes"”
  1. Jan PalusApr 3, 2018
  2. Jeff KingApr 3, 2018
  3. Jan PalusApr 4, 2018
  4. Jeff KingApr 5, 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.