mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <>
To: Jeff King <>
Cc: Duy Nguyen <>,
	"Randall S. Becker" <>,
	Git Mailing List <>
Subject: Re* [Breakage] 2.20.0-rc0 t1404: test_i18ngrep reports 1 instead of 0 on NonStop in one case
Date: Thu, 14 Feb 2019 12:16:20 -0800	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <> (Jeff King's message of "Mon, 11 Feb 2019 19:27:05 -0500")

Jeff King <> writes:

> On Mon, Feb 11, 2019 at 01:07:15PM -0800, Junio C Hamano wrote:
>> >> test_i18ngrep "Unable to create $Q.*packed-refs.lock$Q: File exists" err
>> >
>> > The message does not match, does it? Here we grep for "File exists"
>> > but the message you showed says "File already exists".
>> Hmph, this is from strerror(), right?
>> The question is if we should be using grep to match on strerror()
>> result in the C locale.
> Yeah, I agree that's questionable. And I'm mildly surprised it hasn't
> been a problem before now.
>> Do we really care that the reason of the
>> failure is due to EEXIST for this particular test?
> Hmm. We care to _some_ degree, since that's the condition we set up for
> making sure that update-ref cannot take the lock. But it would probably
> be fine to just confirm that we failed to take the lock. And there,
> checking for just "Unable to create $Q.*packed-refs.lock" would be
> sufficient.


As this came from 6a2a7736 ("t1404: demonstrate two problems with
reference transactions", 2017-09-08), that is as old as Git 2.15,
I'd throw it into "not so urgent" pile.

-- >8 --
Subject: [PATCH] t1404: do not rely on the exact phrasing of strerror()

Not even in C locale, it is wrong to expect that the exact phrasing
"File exists" is used to show EEXIST.

Reported-by: Randall S. Becker <>
Helped-by: Duy Nguyen <>
Helped-by: Jeff King <>
Signed-off-by: Junio C Hamano <>

    I've grepped in t/ directory for the exact phrases of all errno on a
    recent Debian box, and this was the only hit it found.  There
    are two other hits but both in the comments.

 t/ | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/ b/t/
index 51a4f4c0ac..f95a64c911 100755
--- a/t/
+++ b/t/
@@ -614,7 +614,7 @@ test_expect_success 'delete fails cleanly if packed-refs file is locked' '
 	test_when_finished "rm -f .git/packed-refs.lock" &&
 	test_must_fail git update-ref -d $prefix/foo >out 2>err &&
 	git for-each-ref $prefix >actual &&
-	test_i18ngrep "Unable to create $Q.*packed-refs.lock$Q: File exists" err &&
+	test_i18ngrep "Unable to create $Q.*packed-refs.lock$Q:" err &&
 	test_cmp unchanged actual

  parent reply	other threads:[~2019-02-14 20:16 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-10 19:08 [Breakage] 2.20.0-rc0 t1404: test_i18ngrep reports 1 instead of 0 on NonStop in one case Randall S. Becker
2019-02-11  9:56 ` Duy Nguyen
2019-02-11 14:09   ` Randall S. Becker
2019-02-11 21:07   ` Junio C Hamano
2019-02-11 21:48     ` Randall S. Becker
2019-02-12  0:27     ` Jeff King
2019-02-12  0:32       ` Junio C Hamano
2019-02-12  0:35         ` Jeff King
2019-02-14 20:16       ` Junio C Hamano [this message]
2019-02-14 20:32         ` Re* " Randall S. Becker
2019-02-14 21:15           ` Junio C Hamano
2019-02-15  6:08         ` Martin Ågren
2019-02-15 17:51           ` Junio C Hamano

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:

  List information:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \

* 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.
Code repositories for project(s) associated with this public inbox

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 read-only IMAP folder(s) and NNTP newsgroup(s).