Message ID | 20240531112433.GA428583@coredump.intra.peff.net (mailing list archive) |
---|---|
Headers | show |
Series | leak fixes for sparse-checkout code | expand |
On Fri, May 31, 2024 at 07:24:33AM -0400, Jeff King wrote: > But as you might guess, that didn't make t1091 leak-free. And I couldn't > bear leaving it on a cliffhanger like that, so patches 8-13 fix the rest > of the issues triggered by that script. > > And along the way we managed to make t1090 and t3602 leak-free, too > (actually in patch 2, but I didn't notice until the whole thing was > done). Oh, btw, there's one interesting workflow I found. It's nice to see if your incremental work is making things better (and to make sure that the fixes are being exercised somewhere in the test suite). But the granularity of "is this script leak-free" is too coarse to see the incremental steps. Likewise even for individual test failures, as you can have many leaks in a single program. So I ended up doing this a lot: script=t1091-sparse-checkout-builtin.sh make SANITIZE=leak && ( cd t && rm -rf test-results && LSAN_OPTIONS=abort_on_error=0:exitcode=0 \ GIT_TEST_SANITIZE_LEAK_LOG=true \ ./$script ) for i in Indirect Direct; do echo "$i: $(grep "^$i leak" t/test-results/${script%.sh}.leak/* | wc -l)" done It keeps running instead of aborting on leaks (otherwise your counts may go up as "failing" programs are fixed and we run more code). And instead just logs it all and counts up the log entries. I wonder if it would be useful to have something like that baked into test-lib. -Peff
Jeff King <peff@peff.net> writes: > LSAN_OPTIONS=abort_on_error=0:exitcode=0 \ > GIT_TEST_SANITIZE_LEAK_LOG=true \ > ./$script > ) > for i in Indirect Direct; do > echo "$i: $(grep "^$i leak" t/test-results/${script%.sh}.leak/* | wc -l)" > done Neat trick. > It keeps running instead of aborting on leaks (otherwise your counts > may go up as "failing" programs are fixed and we run more code). And > instead just logs it all and counts up the log entries. Indeed. It is a very nice idea. > I wonder if it would be useful to have something like that baked into > test-lib. > > -Peff