git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Josh Steadmon <steadmon@google.com>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Cc: git@vger.kernel.org, gitster@pobox.com, me@ttaylorr.com,
	jeffhost@microsoft.com
Subject: Re: [PATCH v2] test-lib: unset trace2 parent envvars
Date: Tue, 1 Feb 2022 13:22:09 -0800	[thread overview]
Message-ID: <YfmkgeoSGdic83j4@google.com> (raw)
In-Reply-To: <220127.86r18tdeve.gmgdl@evledraar.gmail.com>

On 2022.01.27 04:23, Ævar Arnfjörð Bjarmason wrote:
> 
> On Wed, Jan 26 2022, Josh Steadmon wrote:
> 
> > 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.
> >
> > In t/test-lib.sh, we keep a pattern of permitted GIT_* environment
> > variables. Variables matching /^GIT_TRACE.*/ are currently allowed via
> > this pattern. We want to preserve this behavior, because it can be
> > useful to collect trace output over the entire test suite. Instead of
> > modifying the allow-pattern, we instead fix this issue by unsetting only
> > the GIT_TRACE2_PARENT_NAME and GIT_TRACE2_PARENT_SID in t/test-lib.sh.
> >
> > Reported-by: Emily Shaffer <emilyshaffer@google.com>
> > Signed-off-by: Josh Steadmon <steadmon@google.com>
> > ---
> > Updated commit message and added code comments to explain why we keep
> > "TRACE" in the allow pattern.
> >
> >  t/test-lib.sh | 6 +++++-
> >  1 file changed, 5 insertions(+), 1 deletion(-)
> >
> > diff --git a/t/test-lib.sh b/t/test-lib.sh
> > index 0f7a137c7d..faf25ba1b2 100644
> > --- a/t/test-lib.sh
> > +++ b/t/test-lib.sh
> > @@ -432,7 +432,7 @@ EDITOR=:
> >  unset VISUAL EMAIL LANGUAGE $("$PERL_PATH" -e '
> >  	my @env = keys %ENV;
> >  	my $ok = join("|", qw(
> > -		TRACE
> > +		TRACE	# Allow tracing in general, but see unsets below.
> 
> I think it would be good to turn that -e into a -we, which would tell
> you why this doesn't work the way you think:
> 
>     Possible attempt to put comments in qw() list at -e line 14.
>     Possible attempt to separate words with commas at -e line 14.
> 
> I.e. you added one string "#" to the array, and a string "Allow" etc.

Whoops, yeah, thanks for the catch. I've forgotten most of the Perl I
ever knew but should have seen that.

      parent reply	other threads:[~2022-02-01 21:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=YfmkgeoSGdic83j4@google.com \
    --to=steadmon@google.com \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jeffhost@microsoft.com \
    --cc=me@ttaylorr.com \
    /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.
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).