git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Rubén Justo" <rjusto@gmail.com>
To: Jeff King <peff@peff.net>, Patrick Steinhardt <ps@pks.im>
Cc: Git List <git@vger.kernel.org>
Subject: Re* [PATCH] t0613: mark as leak-free
Date: Wed, 24 Jul 2024 01:07:23 +0200	[thread overview]
Message-ID: <4b1391d5-89c2-41b1-b1de-e1bd26b9f10e@gmail.com> (raw)
In-Reply-To: <20240723210339.GD6779@coredump.intra.peff.net>

On Tue, Jul 23, 2024 at 05:03:39PM -0400, Jeff King wrote:
> On Mon, Jul 22, 2024 at 11:02:24AM +0200, Patrick Steinhardt wrote:
> 
> > > I'd noticed it, too, while doing recent leak fixes. But since Patrick
> > > has been working on leaks and is the go-to person for reftables, I
> > > assumed he had already seen it and there was something clever going on. ;)
> > 
> > Nah, you assumed too much :) I just forgot to mark this as leak-free and
> > the topic crossed with my memory-leak-fix topics, so I didn't yet find
> > the time to fix it.
> 
> Ah, OK. :) Then I think we did the right thing in your absence.

:)

> 
> > It does highlight an issue though: I think memory leak checks should be
> > opt-out rather than opt-in by now. Most of our tests run just fine with
> > the memory leak checker enabled, and that's also where we want to be
> > headed. So making tests opt-out would likely raise more eyebrows when
> > new tests are being added that explicitly opt out.
> > 
> > The only reason I didn't send a patch like this yet is that it would of
> > course create quite a bit of churn in our tests. I'm not sure whether
> > that churn is really worth it, or whether we should instead just
> > continue fixing tests until we can get rid of this marking altogether
> > because all of our tests pass.
> 
> I could see arguments in both directions. I'd worry that by switching
> the default to "assume leak free", it may end up with misalignment
> between who introduces the bug and who deals with the fallout.
> 
> Right now, if I introduce a test that is leak free but don't mark it,
> somebody working on leaks later runs in check mode and says "yay, it
> passes. Let's mark it". It becomes their task to do, but it's an
> easy-ish task.
> 
> If we go the other way, then a new test that _does_ leak means that
> either:
> 
>   1. The original author notices the CI leaks job failing.
> 
>      a. They introduced the leak, and it was caught early. Yay!
> 
>      b. The leak is in some random part of Git that their test happened
> 	to trigger. Now they spend effort proving it was not their fault
> 	before they annotate the test with "does not pass leak".
> 
>   2. The original author does not notice. Somebody notices later when
>      doing leak-checking (or I guess just running their own CI, if we
>      are hitting these by default). Now they are stuck with doing (1a)
>      or (1b) themselves, even though they do not care about the original
>      topic.
> 
> So I dunno. If we think people are paying attention to CI on their
> topics, and we think that we are close enough to leak-free that (1b)
> won't come up a lot, it might make sense. I'm not quite sure we're there
> yet on the latter, but it's mostly gut feeling (and I know things have
> gotten a bit better recently, too).

I don't know either.  Maybe it seems a bit early still considering the
numbers we have: 

   $ git grep -l PASSES_SANITIZE_LEAK=true t/t[0-9][0-9][0-9][0-9]-*.sh | wc -l
   678
   $ git grep -L PASSES_SANITIZE_LEAK=true t/t[0-9][0-9][0-9][0-9]-*.sh | wc -l
   329

BTW, perhaps we want to do this:

----- >8 --------- >8 --------- >8 --------- >8 ----
Subject: [PATCH] t: do not mark tests as no-leak-free

The mark TEST_PASSES_SANITIZE_LEAK=false and the absence of it mean the
same thing: the test triggers leaks.  However, explicitly declaring that
the test leak, with TEST_PASSES_SANITIZE_LEAK=false, can suggest there
is some special consideration for it, which is not the case.

Looking back at the history of the tests we're modifying in this patch,
we see that both were marked as "leak-free", but later started
triggering leaks and had to be re-marked accordingly as "no-leak-free".
Instead of removing the mark entirely, it was changed to "false".

It doesn't seem to have much historical value to keep the mark for this
reason, and removing it reduces the confusion that it has some special
meaning.

Do it so.

Signed-off-by: Rubén Justo <rjusto@gmail.com>
---
 t/t0210-trace2-normal.sh | 1 -
 t/t0211-trace2-perf.sh   | 1 -
 2 files changed, 2 deletions(-)

diff --git a/t/t0210-trace2-normal.sh b/t/t0210-trace2-normal.sh
index c312657a12..eff9a59dbd 100755
--- a/t/t0210-trace2-normal.sh
+++ b/t/t0210-trace2-normal.sh
@@ -2,7 +2,6 @@
 
 test_description='test trace2 facility (normal target)'
 
-TEST_PASSES_SANITIZE_LEAK=false
 . ./test-lib.sh
 
 # Turn off any inherited trace2 settings for this test.
diff --git a/t/t0211-trace2-perf.sh b/t/t0211-trace2-perf.sh
index 070fe7a5da..b9421a64a7 100755
--- a/t/t0211-trace2-perf.sh
+++ b/t/t0211-trace2-perf.sh
@@ -2,7 +2,6 @@
 
 test_description='test trace2 facility (perf target)'
 
-TEST_PASSES_SANITIZE_LEAK=false
 . ./test-lib.sh
 
 # Turn off any inherited trace2 settings for this test.


  reply	other threads:[~2024-07-23 23:07 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-30  6:46 [PATCH] t0613: mark as leak-free Rubén Justo
2024-07-01  3:57 ` Jeff King
2024-07-01 19:35   ` Rubén Justo
2024-07-01 19:38     ` t0612: " Rubén Justo
2024-07-01 19:40       ` Eric Sunshine
2024-07-01 19:44     ` [PATCH] " Rubén Justo
2024-07-22  9:02   ` [PATCH] t0613: " Patrick Steinhardt
2024-07-23 21:03     ` Jeff King
2024-07-23 23:07       ` Rubén Justo [this message]
2024-07-24  5:16         ` Re* " Patrick Steinhardt
2024-07-24  6:45           ` Rubén Justo

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=4b1391d5-89c2-41b1-b1de-e1bd26b9f10e@gmail.com \
    --to=rjusto@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    --cc=ps@pks.im \
    /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;
as well as URLs for NNTP newsgroup(s).