Lei Zhang | 16 Jun 2012 00:23

Leaky Tests Fixlit results

Hi folks,

A couple weeks ago, the Chrome team in LA had a one-day fixlit to
tackle leaky tests. We looked at both tests that leak memory according
to Valgrind/Heapchecker, and tests that leaked files. Here's some
stats and lessons learned from our fixlit.

As a team, we:

- Attempted to tackle 62 bugs
- Triaged 44 bugs
- Fixed 7 bugs
-- 5 memory leaks, 1 of which affected the shipping product
-- 2 file leaks
- Made 51 commits
- Removed 77 Valgrind / Heapchecker suppressions

For file leaks, the solution came down to using ScopedTempDir so the
directories can be automatically deleted. One most also use
ScopedTempDir correctly by calling CreateUniqueTempDir(), otherwise
ScopedTempDir::path() will simply return the current working directory
instead.

For memory leaks, we noticed there were a lot of stale suppressions.
Some of these are due to people fixing leaks but forgetting to remove
the suppressions. Other stale suppressions are from tests that no
longer exists. We found http://chromium-build-logs.appspot.com/ to be
useful for searching old logs to see when a Vaglrind / Heapchecker
suppression was last used.

(Continue reading)

Lei Zhang | 24 Sep 2012 21:35

Re: Leaky Tests Fixlit results

Since we spent so much time triaging bugs in the first fixlet, we ran
a second fixlet at the end of August and concentrated on fixing actual
leaks. I picked a not-so-good day for the fixlet, so participation was
a bit low. Nevertheless, we managed to 7 leaks between just a few
people:

http://crbug.com/98967 - test function did not take ownership of a pointer.
http://crbug.com/143565 - test teardown needed to run the message loop
one more time.
http://crbug.com/145644 - delegate ownership confusion.
http://crbug.com/145700 - caller forgot to use base::Owned with a PostTask().
http://crbug.com/145706 - test forgot to use scoped_ptr.
http://crbug.com/145728 - caller made an unnecessary Value::DeepCopy().
http://crbug.com/145742 - circular reference.

On Fri, Jun 15, 2012 at 3:23 PM, Lei Zhang <thestig <at> chromium.org> wrote:
> Hi folks,
>
> A couple weeks ago, the Chrome team in LA had a one-day fixlit to
> tackle leaky tests. We looked at both tests that leak memory according
> to Valgrind/Heapchecker, and tests that leaked files. Here's some
> stats and lessons learned from our fixlit.
>
> As a team, we:
>
> - Attempted to tackle 62 bugs
> - Triaged 44 bugs
> - Fixed 7 bugs
> -- 5 memory leaks, 1 of which affected the shipping product
> -- 2 file leaks
(Continue reading)


Gmane