All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Thomas Gummerer <t.gummerer@gmail.com>
Cc: "Torsten Bögershausen" <tboegi@web.de>,
	"Git Mailing List" <git@vger.kernel.org>,
	szeder.dev@gmail.com, "Jan Palus" <jpalus@fastmail.com>,
	"Johannes Schindelin" <Johannes.Schindelin@gmx.de>
Subject: Re: [PATCH] t5570: drop racy test
Date: Thu, 20 Dec 2018 12:14:38 -0500	[thread overview]
Message-ID: <20181220171438.GA6684@sigill.intra.peff.net> (raw)
In-Reply-To: <20181220164150.GB25639@hank.intra.tgummerer.com>

On Thu, Dec 20, 2018 at 04:41:50PM +0000, Thomas Gummerer wrote:

> > That doesn't really fix it, but just broadens the race window. I dunno.
> > Maybe that is enough in practice. We could do something like:
> > 
> >   repeat_with_timeout () {
> > 	local i=0
> > 	while test $i -lt 10
> > 	do
> > 		"$@" && return 0
> > 		sleep 1
> > 	done
> > 	# no success even after 10 seconds
> > 	return 1
> >   }
> > 
> >   repeat_with_timeout grep -i extended.attribute daemon.log
> > 
> > to make the pattern a bit more obvious (and make it easy to extend the
> > window arbitrarily; surely 10s is enough?).
> 
> I gave this a try, with below patch to lib-git-daemon.sh that you
> proposed in the previous thread about this racyness.  That shows
> another problem though, namely when truncating 'daemon.log' before
> running 'git ls-remote' in this test, we're not sure all 'git deamon'
> has flushed everything from previous invocations.  That may be an even
> rarer problem in practice, but still something to keep in mind.

Right, that makes sense. Making this race-proof really does require a
separate log stream for each test. I guess we'd need to be able to send
git-daemon a signal to re-open the log (which actually is not as
unreasonable as it may seem; lots of daemons have this for log
rotation).

I think getting rid of the "cat" would also help a lot here.
Unfortunately I think we use it not just for its "tee" effect, but also
to avoid startup races by checking the "Ready to rumble" line. So again,
we'd need some cooperation from git-daemon to tell us out-of-band that
it has completed its startup (e.g., by touching another file).

> Dscho also mentioned on #git-devel a while ago that he may have a look
> at actually making this test race-proof, but I guess he's been busy
> with the 2.20 release.  I'm also not sure it's worth spending a lot of
> time trying to fix this test, but I'd definitely be happy if someone
> proposes a different solution.

Yeah. I'm sure it's fixable with enough effort, but I just think there
are more interesting and important things to work on.

> --- >8 ---
> Subject: [PATCH] t5570: drop racy test

So yeah, I'm still fine with this. But...

> ---
>  t/t5570-git-daemon.sh | 13 -------------
>  1 file changed, 13 deletions(-)

This is the only user of daemon.log, so we could drop those bits from
lib-git-daemon.sh, too. That would also prevent people from adding new
tests, thinking that this was somehow not horribly racy). I.e.,
reverting 314a73d658 (t/lib-git-daemon: record daemon log, 2018-01-25).

-Peff

  reply	other threads:[~2018-12-20 17:15 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-25 20:52 t5570 shaky for anyone ? Torsten Bögershausen
2018-11-25 22:01 ` Thomas Gummerer
2018-11-26 16:42   ` Jeff King
2018-12-20 16:41     ` [PATCH] t5570: drop racy test Thomas Gummerer
2018-12-20 17:14       ` Jeff King [this message]
2018-12-21 15:48         ` Johannes Schindelin
2019-01-06 17:59           ` Thomas Gummerer
2019-01-06 17:53       ` [PATCH 2/1] Revert "t/lib-git-daemon: record daemon log" Thomas Gummerer
2019-01-07  8:20         ` Jeff King
2019-01-07 15:45           ` Junio C Hamano
2018-11-25 22:22 ` t5570 shaky for anyone ? SZEDER Gábor
2018-11-26 16:45   ` 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=20181220171438.GA6684@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=jpalus@fastmail.com \
    --cc=szeder.dev@gmail.com \
    --cc=t.gummerer@gmail.com \
    --cc=tboegi@web.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.