Skip Menu |

This queue is for tickets about the Test-LeakTrace CPAN distribution.

Report information
The Basics
Id: 44572
Status: resolved
Priority: 0/
Queue: Test-LeakTrace

People
Owner: Nobody in particular
Requestors: frequency [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.07
Fixed in: (no value)



Subject: Failure With Devel::Cover
When running this test with Test::LeakTrace: no_leaks_ok(sub { my $obj = Math::Random::ISAAC::PP->new(time); for (0..10) { $obj->irand(); } }, 'Using irand does not leak memory'); I get a success via prove. However, once I enable Devel::Cover (ie, via cover -test or the ./Build testcover), then I get a bunch of leaked scalars. This is the output under prove: Show quoted text
> prove --verbose -Ilib t/01memory.t
t/01memory.... 1..2 ok 1 - Using irand does not leak memory ok 2 - Using irand does not leak memory ok All tests successful. Files=1, Tests=2, 0 wallclock secs ( 0.02 usr 0.01 sys + 0.02 cusr 0.01 csys = 0.06 CPU) Result: PASS However, this is the output under cover -test: t/01memory..........1/2 # Failed test 'Using irand does not leak memory' # at t/01memory.t line 37. # got: 15 # expected: 0 A simple workaround would be to alert the user that the test may be wrong if Devel::Cover is in use, or put that in the documentation somewhere. Better may be to turn the tests into no-ops with appropriate diagnostic output if Devel::Cover is in use. Or maybe it's all a problem on my end, and I should just skip the tests if running with Devel::Cover. Nonetheless, I think some documentation stating this problem would be nice :-)
Hi, Thanks for your report. In the version 0.9, I have added the CAVEATS section to the pod. Is it OK? -- Goro Fuji (gfx) GFUJI at CPAN.org
On Tue Mar 31 03:40:26 2009, GFUJI wrote: Show quoted text
> Hi, > > Thanks for your report. In the version 0.9, I have added the CAVEATS > section to the pod. > Is it OK?
Hi: Thanks for the quick response. I would say that the bug has been resolved, so I've updated its status as such. In my code, I just do this: if (exists($INC{'Devel/Cover.pm'})) { plan skip_all => 'This test is not compatible with Devel::Cover'; } Which might be something you can consider adding for a future release. That it outputs "ok" is good, but perhaps also useful would be adding some diagnostic output if, say, $ENV{TEST_VERBOSE} is true. Anyway, just some thoughts; just nice if someone is trying to figure out why the test is always returning ok :-) Thanks again for your code and for your quick response!