Skip Menu |
 

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

Report information
The Basics
Id: 129908
Status: resolved
Priority: 0/
Queue: Test-Refcount

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

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 0.10



Subject: Tests fail (if Devel::FindRef and Devel::MAT are installed?) (0.09)
Download (untitled) / with headers
text/plain 1.1k
On some of my smoker systems the test suite fails like this: ... # Failed test 'two refs to object fails to be 1' # at t/01count.t line 49. # STDERR is: # > # Failed test 'one ref' # > # at t/01count.t line 48. # > # expected 1 references, found 2 # > # SV address is 0x42fe0df8 # > # Writing heap dump to t/01count-1.pmat # > # Some::Class=HASH(0x42fe0df8) [refcount 2] is # > # +- referenced by REF(0x42fe0138) [refcount 1], which is # > # | the array element 36 of ARRAY(0x4143e4f8) [refcount 1], which is # > # | the array element 1 of ARRAY(0x4143e4c8) [refcount 1], which is # > # | not found anywhere I looked :( # > # +- referenced by REF(0x42fe0048) [refcount 1], which is # > # the array element 26 of ARRAY(0x4143e4f8) [refcount 1], which was seen before. # not: # > /#\s+Failed\ test.*?\n?.*?at\ t\/01count\.t line 48.*\n?/ # > # expected 1 references, found 2 # > (?^:^# Some::Class=HASH\(0x[0-9a-f]+\) (?:\[refcount 2\] )?is\n)(?^m:(?:^#.*\n){1,}) # > # > # > # > # > # > # > # > # > # as expected t/01count.t ..... Failed 1/8 subtests ... (etc) ... This seems to happen if Devel::FindRef and Devel::MAT are installed.
Download (untitled) / with headers
text/plain 196b
On Tue Jun 25 16:44:02 2019, SREZIC wrote: Show quoted text
> This seems to happen if Devel::FindRef and Devel::MAT are installed.
Oops, yes I forgot to test it in that scenario. Patch attached. -- Paul Evans
Subject: rt129908.patch
Download rt129908.patch
text/x-diff 3.1k
=== modified file 't/01count.t' --- t/01count.t 2019-06-24 16:20:36 +0000 +++ t/01count.t 2019-06-26 10:25:22 +0000 @@ -8,8 +8,6 @@ use Test::Refcount; -use constant HAVE_DEVEL_FINDREF => eval { require Devel::FindRef }; - my $anon = []; test_out( "ok 1 - anon ARRAY ref" ); @@ -37,14 +35,14 @@ test_out( "not ok 1 - one ref" ); test_fail( +10 ); test_err( "# expected 1 references, found 2" ); -test_err( qr/^# Some::Class=HASH\(0x[0-9a-f]+\) (?:\[refcount 2\] )?is\n/ ) if HAVE_DEVEL_FINDREF; -if( HAVE_DEVEL_FINDREF ) { - test_err( qr/(?:^#.*\n){1,}/m ); # Don't be sensitive on what Devel::FindRef actually prints -} -elsif( Test::Refcount::HAVE_DEVEL_MAT_DUMPER ) { +if( Test::Refcount::HAVE_DEVEL_MAT_DUMPER ) { test_err( qr/^# SV address is 0x[0-9a-f]+\n/ ); test_err( qr/^# Writing heap dump to \S+\n/ ); } +if( Test::Refcount::HAVE_DEVEL_FINDREF ) { + test_err( qr/^# Some::Class=HASH\(0x[0-9a-f]+\) (?:\[refcount 2\] )?is\n/ ); + test_err( qr/(?:^#.*\n){1,}/m ); # Don't be sensitive on what Devel::FindRef actually prints +} is_refcount( $object, 1, 'one ref' ); test_test( "two refs to object fails to be 1" ); === modified file 't/02one.t' --- t/02one.t 2019-06-24 16:20:36 +0000 +++ t/02one.t 2019-06-26 10:25:22 +0000 @@ -8,8 +8,6 @@ use Test::Refcount; -use constant HAVE_DEVEL_FINDREF => eval { require Devel::FindRef }; - my $anon = []; test_out( "ok 1 - anon ARRAY ref" ); @@ -27,14 +25,14 @@ test_out( "not ok 1 - one ref" ); test_fail( +10 ); test_err( "# expected 1 references, found 2" ); -if( HAVE_DEVEL_FINDREF ) { +if( Test::Refcount::HAVE_DEVEL_MAT_DUMPER ) { + test_err( qr/^# SV address is 0x[0-9a-f]+\n/ ); + test_err( qr/^# Writing heap dump to \S+\n/ ); +} +if( Test::Refcount::HAVE_DEVEL_FINDREF ) { test_err( qr/^# Some::Class=HASH\(0x[0-9a-f]+\) (?:\[refcount 2\] )?is\n/ ); test_err( qr/(?:^#.*\n){1,}/m ); # Don't be sensitive on what Devel::FindRef actually prints } -elsif( Test::Refcount::HAVE_DEVEL_MAT_DUMPER ) { - test_err( qr/^# SV address is 0x[0-9a-f]+\n/ ); - test_err( qr/^# Writing heap dump to \S+\n/ ); -} is_oneref( $object, 'one ref' ); test_test( "two refs to object fails to be 1" ); === modified file 't/03weak.t' --- t/03weak.t 2019-06-24 16:20:36 +0000 +++ t/03weak.t 2019-06-26 10:25:22 +0000 @@ -10,8 +10,6 @@ use Test::Refcount; -use constant HAVE_DEVEL_FINDREF => eval { require Devel::FindRef }; - my $object = bless {}, "Some::Class"; my $newref = $object; @@ -19,14 +17,14 @@ test_out( "not ok 1 - one ref" ); test_fail( +10 ); test_err( "# expected 1 references, found 2" ); -if( HAVE_DEVEL_FINDREF ) { +if( Test::Refcount::HAVE_DEVEL_MAT_DUMPER ) { + test_err( qr/^# SV address is 0x[0-9a-f]+\n/ ); + test_err( qr/^# Writing heap dump to \S+\n/ ); +} +if( Test::Refcount::HAVE_DEVEL_FINDREF ) { test_err( qr/^# Some::Class=HASH\(0x[0-9a-f]+\) (?:\[refcount 2\] )?is\n/ ); test_err( qr/(?:^#.*\n){1,}/m ); # Don't be sensitive on what Devel::FindRef actually prints } -elsif( Test::Refcount::HAVE_DEVEL_MAT_DUMPER ) { - test_err( qr/^# SV address is 0x[0-9a-f]+\n/ ); - test_err( qr/^# Writing heap dump to \S+\n/ ); -} is_oneref( $object, 'one ref' ); test_test( "two refs to object fails to be 1" );
Fixed in 0.10 -- Paul Evans


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.