[PATCH] t7518: fix flaky grep invocation

Subsystems: the rest

STALE2120d

2 messages, 2 authors, 2020-10-17 · open the first message on its own page

[PATCH] t7518: fix flaky grep invocation

From: Elijah Newren via GitGitGadget <hidden>
Date: 2020-10-16 23:39:59

From: Elijah Newren <redacted>

t7518.1 added in commit 862e80a413 ("ident: handle NULL email when
complaining of empty name", 2017-02-23), was trying to make sure that
the test with an empty ident did not segfault and did not result in
glibc quiety translating a NULL pointer into a name of "(null)".  It did
the latter by ensuring that a grep for "null" didn't appear in the
output, but on one automatic CI run I observed the following output:

fatal: empty ident name (for [off-list ref]) not allowed

Note that 'null' appears as a substring of the domain name, found
within 'gcliasfzo2nullsdbrimjtbyhg'.  Tighten the test by searching for
"(null)" rather than "null".

Signed-off-by: Elijah Newren <redacted>
---
    t7518: fix flaky grep invocation

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-884%2Fnewren%2Ffix-flaky-t7518-grep-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-884/newren/fix-flaky-t7518-grep-v1
Pull-Request: https://github.com/git/git/pull/884

 t/t7518-ident-corner-cases.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/t/t7518-ident-corner-cases.sh b/t/t7518-ident-corner-cases.sh
index dc3e9c8c88..905957bd0a 100755
--- a/t/t7518-ident-corner-cases.sh
+++ b/t/t7518-ident-corner-cases.sh
@@ -13,7 +13,7 @@ test_expect_success 'empty name and missing email' '
 		sane_unset GIT_AUTHOR_EMAIL &&
 		GIT_AUTHOR_NAME= &&
 		test_must_fail git commit --allow-empty -m foo 2>err &&
-		test_i18ngrep ! null err
+		test_i18ngrep ! "(null)" err
 	)
 '
 
base-commit: d4a392452e292ff924e79ec8458611c0f679d6d4
-- 
gitgitgadget

Re: [PATCH] t7518: fix flaky grep invocation

From: Taylor Blau <hidden>
Date: 2020-10-17 05:34:53

Hi Elijah,

On Fri, Oct 16, 2020 at 11:39:54PM +0000, Elijah Newren via GitGitGadget wrote:
From: Elijah Newren <redacted>

t7518.1 added in commit 862e80a413 ("ident: handle NULL email when
complaining of empty name", 2017-02-23), was trying to make sure that
the test with an empty ident did not segfault and did not result in
glibc quiety translating a NULL pointer into a name of "(null)".  It did
the latter by ensuring that a grep for "null" didn't appear in the
output, but on one automatic CI run I observed the following output:
:-). I have always been surprised by glibc's behavior here; I'd almost
always rather have a segfault than silently turning a NULL pointer into
"(null)" when formatted with "%s".
fatal: empty ident name (for [off-list ref]) not allowed

Note that 'null' appears as a substring of the domain name, found
within 'gcliasfzo2nullsdbrimjtbyhg'.  Tighten the test by searching for
"(null)" rather than "null".
Yep; that sounds like a straightforward fix that will make this test
non-flaky.

  Reviewed-by: Taylor Blau [off-list ref]

Thanks,
Taylor
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help