git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] test-lib: unset trace2 parent envvars
@ 2022-01-14  3:33 Josh Steadmon
  2022-01-14  6:01 ` Junio C Hamano
  2022-01-26 22:10 ` [PATCH v2] " Josh Steadmon
  0 siblings, 2 replies; 10+ messages in thread
From: Josh Steadmon @ 2022-01-14  3:33 UTC (permalink / raw)
  To: git

The trace2 subsystem can inherit certain information from parent
processes via environment variables; e.g., the parent command name and
session ID. This allows trace2 to note when a command is the child
process of another Git process, and to adjust various pieces of output
accordingly.

This behavior breaks certain tests that examine trace2 output when the
tests run as a child of another git process, such as in `git rebase -x
"make test"`.

While we could fix this by unsetting the relevant variables in the
affected tests (currently t0210, t0211, t0212, and t6421), this would
leave other tests vulnerable to similar breakage if new test cases are
added which inspect trace2 output. So fix this in general by unsetting
GIT_TRACE2_PARENT_NAME and GIT_TRACE2_PARENT_SID in test-lib.sh.

Reported-by: Emily Shaffer <emilyshaffer@google.com>
Helped-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Josh Steadmon <steadmon@google.com>
---
 t/test-lib.sh | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/t/test-lib.sh b/t/test-lib.sh
index 0f7a137c7d..e4716b0b86 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -449,6 +449,8 @@ unset VISUAL EMAIL LANGUAGE $("$PERL_PATH" -e '
 unset XDG_CACHE_HOME
 unset XDG_CONFIG_HOME
 unset GITPERLLIB
+unset GIT_TRACE2_PARENT_NAME
+unset GIT_TRACE2_PARENT_SID
 TEST_AUTHOR_LOCALNAME=author
 TEST_AUTHOR_DOMAIN=example.com
 GIT_AUTHOR_EMAIL=${TEST_AUTHOR_LOCALNAME}@${TEST_AUTHOR_DOMAIN}

base-commit: dcc0cd074f0c639a0df20461a301af6d45bd582e
-- 
2.34.1.703.g22d0c6ccf7-goog


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-02-01 21:23 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-14  3:33 [PATCH] test-lib: unset trace2 parent envvars Josh Steadmon
2022-01-14  6:01 ` Junio C Hamano
2022-01-18 21:23   ` Josh Steadmon
2022-01-18 21:50     ` Junio C Hamano
2022-01-26 22:11       ` Josh Steadmon
2022-01-18 21:29   ` Taylor Blau
2022-01-26 22:10 ` [PATCH v2] " Josh Steadmon
2022-01-27  3:23   ` Ævar Arnfjörð Bjarmason
2022-01-27 18:29     ` Junio C Hamano
2022-02-01 21:22     ` Josh Steadmon

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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).