From: Patrick Steinhardt <ps@pks.im>
To: Jeff King <peff@peff.net>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 1/3] test-lib: stop showing old leak logs
Date: Thu, 26 Sep 2024 16:19:16 +0200 [thread overview]
Message-ID: <ZvVtZDrUwkdeRbje@pks.im> (raw)
In-Reply-To: <20240924213540.GA1142403@coredump.intra.peff.net>
On Tue, Sep 24, 2024 at 05:35:40PM -0400, Jeff King wrote:
> We ask LSan to record the logs of all leaks in test-results/, which is
> useful for finding leaks that didn't trigger a test failure.
>
> We don't clean out the leak/ directory for each test before running it,
> though. Instead, we count the number of files it has, and complain only
> if we ended up with more when the script finishes. So we shouldn't
> trigger any output if you've made a script leak free. But if you simply
> _reduced_ the number of leaks, then there is an annoying outcome: we do
> not record which logs were from this run and which were from previous
> ones. So when we dump them to stdout, you get a mess of
> possibly-outdated leaks. This is very confusing when you are in an
> edit-compile-test cycle trying to fix leaks.
>
> The instructions do note that you should "rm -rf test-results/" if you
> want to avoid this. But I'm having trouble seeing how this cumulative
> count could ever be useful. It is not even counting the number of leaks,
> but rather the number of processes with at least one leak!
>
> So let's just blow away the per-test leak/ directory before running. We
> already overwrite the ".out" file in test-results/ in the same way, so
> this is following that pattern.
>
> Running "make test" isn't affected by this, since it blows away all of
> test-results/ already. This only comes up when you are iterating on a
> single script that you're running manually.
I'm very much in favor of this change. I frequently re-ran tests with
leak checking enabled only to realize that, oops, I forgot to "rm -rf"
the leak directory first. So eventually I ended up with the following
command:
$ rm -rf /tmp/git-tests/ && make -C .. -j20 SANITIZE=leak && ./t5310-pack-bitmaps.sh -ix
Every time I didn't use it I soon came to regret it.
Patrick
next prev parent reply other threads:[~2024-09-26 14:19 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-24 21:34 [PATCH 0/3] LSan quality of life improvements Jeff King
2024-09-24 21:35 ` [PATCH 1/3] test-lib: stop showing old leak logs Jeff King
2024-09-26 14:19 ` Patrick Steinhardt [this message]
2024-09-24 21:36 ` [PATCH 2/3] test-lib: show leak-sanitizer logs on --immediate failure Jeff King
2024-09-26 14:19 ` Patrick Steinhardt
2024-09-24 21:38 ` [PATCH 3/3] test-lib: check for leak logs after every test Jeff King
2024-09-26 14:19 ` Patrick Steinhardt
2024-09-27 3:58 ` Jeff King
2024-09-26 14:19 ` [PATCH 0/3] LSan quality of life improvements Patrick Steinhardt
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=ZvVtZDrUwkdeRbje@pks.im \
--to=ps@pks.im \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
/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).