From: Jan Palus <jpalus@fastmail.com>
To: git@vger.kernel.org
Subject: Timing issue in t5570 "daemon log records all attributes"
Date: Tue, 03 Apr 2018 21:33:10 +0200 [thread overview]
Message-ID: <1522783990.964448.1325338528.0D49CC15@webmail.messagingengine.com> (raw)
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 reply other threads:[~2018-04-03 19:33 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-03 19:33 Jan Palus [this message]
2018-04-03 20:32 ` Timing issue in t5570 "daemon log records all attributes" Jeff King
2018-04-04 21:57 ` Jan Palus
2018-04-05 16:39 ` Jeff King
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1522783990.964448.1325338528.0D49CC15@webmail.messagingengine.com \
--to=jpalus@fastmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).