public inbox for git@vger.kernel.org
 help / color / mirror / Atom feed
From: Patrick Steinhardt <ps@pks.im>
To: Jeff King <peff@peff.net>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] t9001: use a more distinct fake BugID
Date: Mon, 16 Sep 2024 09:27:36 +0200	[thread overview]
Message-ID: <Zufd4BmUu_fRBBrd@pks.im> (raw)
In-Reply-To: <20240915113115.GA2019070@coredump.intra.peff.net>

On Sun, Sep 15, 2024 at 07:31:15AM -0400, Jeff King wrote:
> In the test "cc list is sanitized", we feed a commit with a variety of
> trailers to send-email, and then check its output to see how it handled
> them. For most of them, we are grepping for a specific mention of the
> header, but there's a "BugID" header which we expect to be ignored. We
> confirm this by grepping for "12345", the fake BugID, and making sure it
> is not present.
> 
> But we can be fooled by false positives! I just tracked down a flaky
> test failure here that was caused by matching this unrelated line in the
> output:
> 
>   <20240914090449.612345-1-author@example.com>
> 
> which will change from run to run based on the time, pid, etc.
> 
> Ideally we'd tighten the regex to make this more specifically, but since
> the point is that it _shouldn't_ be mentioned, it's hard to say what the
> right match would be (e.g., would there be a leading space?).
> 
> Instead, let's just choose a match that is much less likely to appear.
> The actual content of the header isn't important, since it's supposed to
> be ignored.
> 
> Signed-off-by: Jeff King <peff@peff.net>
> ---
> I guess this is fairly unlikely, as re-running the test with --stress
> didn't reproduce after a few hundred attempts. Back of the envelope, I
> guess any 5-digit sequence has a 1-in-10^5 chance of matching our
> target. There are 2 in chances in a 6-digit pid. Some in the date, but
> as there's no December 34th or hour 34, you're limited to a few specific
> times like 01:23:45 (or at 11am), 12:34:5x, or perhaps 23:45 on the 1st,
> 11th, or 21st of the month.
> 
> So I think I just got really unlucky, but after spending several minutes
> debugging, I wouldn't want to wish it on anybody else. ;)

Heh, unlucky indeed. In any case, the change makes sense to me, thanks!

Patrick

      reply	other threads:[~2024-09-16  7:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-15 11:31 [PATCH] t9001: use a more distinct fake BugID Jeff King
2024-09-16  7:27 ` Patrick Steinhardt [this message]

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=Zufd4BmUu_fRBBrd@pks.im \
    --to=ps@pks.im \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    /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