Skip Menu |

This queue is for tickets about the Devel-MAT CPAN distribution.

Report information
The Basics
Id: 126041
Status: patched
Priority: 0/
Queue: Devel-MAT

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

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



Subject: Fails with HARNESS_OPTIONS=j2
Sample fail report: http://www.cpantesters.org/cpan/report/97375755 I have reproduced with two smokers. I let them run several times with and without HARNESS_OPTIONS=j2. Consistently the parallel running setup failed. I patched all but one of the tests to use a custom dumpfile name, like so and the problem went away. The file t/10tool-inrefs.t was left untouched because it did not pass anymore with the analogous change.
Subject: devel-mat-0.39.diff
--- t/01self.t~ 2018-08-09 12:39:14.000000000 +0000 +++ t/01self.t 2018-08-11 06:14:16.663179857 +0000 @@ -13,7 +13,7 @@ my $ADDR = qr/0x[0-9a-f]+/; -my $DUMPFILE = "test.pmat"; +my $DUMPFILE = "test-$$.pmat"; Devel::MAT::Dumper::dump( $DUMPFILE ); #END { unlink $DUMPFILE; } --- t/02contexts.t~ 2018-08-09 12:39:14.000000000 +0000 +++ t/02contexts.t 2018-08-11 06:14:16.663179857 +0000 @@ -8,7 +8,7 @@ use Devel::MAT::Dumper; use Devel::MAT; -my $DUMPFILE = "test.pmat"; +my $DUMPFILE = "test-$$.pmat"; my $inner_l0 = __LINE__+1; sub inner { --- t/10tool-identify.t~ 2018-08-09 12:39:14.000000000 +0000 +++ t/10tool-identify.t 2018-08-11 06:14:16.663179857 +0000 @@ -10,7 +10,7 @@ use Devel::MAT; use Scalar::Util qw( refaddr ); -my $DUMPFILE = "test.pmat"; +my $DUMPFILE = "test-$$.pmat"; our %HASH = ( array => [ my $SCALAR = \"foobar" ], --- t/10tool-reachability.t~ 2018-08-09 12:39:14.000000000 +0000 +++ t/10tool-reachability.t 2018-08-11 06:14:16.663179857 +0000 @@ -11,7 +11,7 @@ use Devel::MAT::Dumper; use Devel::MAT; -my $DUMPFILE = "test.pmat"; +my $DUMPFILE = "test-$$.pmat"; # Set up a reference cycle with an easy-to-find PV in it # Run this from an anonymous sub so we know the lexical is dropped --- t/10tool-sizes.t~ 2018-08-09 12:39:14.000000000 +0000 +++ t/10tool-sizes.t 2018-08-11 06:14:16.663179857 +0000 @@ -8,7 +8,7 @@ use Devel::MAT::Dumper; use Devel::MAT; -my $DUMPFILE = "test.pmat"; +my $DUMPFILE = "test-$$.pmat"; our $EMPTY_SVIV = 123; our @EMPTY_AV = ();
On Sat Aug 11 02:28:18 2018, ANDK wrote: Show quoted text
> Sample fail report: > > http://www.cpantesters.org/cpan/report/97375755 > > I have reproduced with two smokers. I let them run several times with > and without HARNESS_OPTIONS=j2. Consistently the parallel running > setup failed.
Ohyes; collisions of the same `test.pmat` file - that looks quite plausible. I wonder if actually it'd be better to use __FILE__.".pmat" so the files are named after the .t files themselves. Easier to identify them for debug purposes afterwards if you comment out the END block that unlinks them. -- Paul Evans
Attached is a better patch, which also fixes the inrefs one. -- Paul Evans
Subject: rt126041.patch
=== modified file 't/01self.t' --- t/01self.t 2018-07-24 13:22:02 +0000 +++ t/01self.t 2018-08-11 15:30:41 +0000 @@ -13,10 +13,10 @@ my $ADDR = qr/0x[0-9a-f]+/; -my $DUMPFILE = "test.pmat"; +my $DUMPFILE = __FILE__ =~ s/\.t/\.pmat/r; Devel::MAT::Dumper::dump( $DUMPFILE ); -#END { unlink $DUMPFILE; } +END { unlink $DUMPFILE; } my $pmat = Devel::MAT->load( $DUMPFILE ); my $df = $pmat->dumpfile; === modified file 't/02contexts.t' --- t/02contexts.t 2017-12-18 19:39:14 +0000 +++ t/02contexts.t 2018-08-11 15:30:41 +0000 @@ -8,7 +8,7 @@ use Devel::MAT::Dumper; use Devel::MAT; -my $DUMPFILE = "test.pmat"; +my $DUMPFILE = __FILE__ =~ s/\.t/\.pmat/r; my $inner_l0 = __LINE__+1; sub inner { === modified file 't/10tool-identify.t' --- t/10tool-identify.t 2018-07-18 16:56:58 +0000 +++ t/10tool-identify.t 2018-08-11 15:30:41 +0000 @@ -10,7 +10,7 @@ use Devel::MAT; use Scalar::Util qw( refaddr ); -my $DUMPFILE = "test.pmat"; +my $DUMPFILE = __FILE__ =~ s/\.t/\.pmat/r; our %HASH = ( array => [ my $SCALAR = \"foobar" ], === modified file 't/10tool-inrefs.t' --- t/10tool-inrefs.t 2017-10-12 00:24:20 +0000 +++ t/10tool-inrefs.t 2018-08-11 15:30:41 +0000 @@ -13,7 +13,7 @@ my $ADDR = qr/0x[0-9a-f]+/; -my $DUMPFILE = "test.pmat"; +my $DUMPFILE = __FILE__ =~ s/\.t/\.pmat/r; Devel::MAT::Dumper::dump( $DUMPFILE ); END { unlink $DUMPFILE; } @@ -48,20 +48,14 @@ { my @pvs = grep { $_->desc =~ m/^SCALAR/ and defined $_->pv and - $_->pv eq "test.pmat" } $df->heap; + $_->pv eq $DUMPFILE } $df->heap; - # There's likely 3 items in this list: - # 2 constants within the main code + # There's likely only one item in this list: # 1 value of the $DUMPFILE lexical itself - my @constants = grep { - grep { $_->name eq 'a constant' } $_->inrefs - } @pvs; - my ( $lexical ) = grep { grep { $_->name eq 'the lexical $DUMPFILE' } $_->inrefs } @pvs; - ok( scalar @constants, 'Found some constants' ); ok( $lexical, 'Found the $DUMPFILE lexical' ); } === modified file 't/10tool-reachability.t' --- t/10tool-reachability.t 2013-11-22 00:24:16 +0000 +++ t/10tool-reachability.t 2018-08-11 15:30:41 +0000 @@ -11,7 +11,7 @@ use Devel::MAT::Dumper; use Devel::MAT; -my $DUMPFILE = "test.pmat"; +my $DUMPFILE = __FILE__ =~ s/\.t/\.pmat/r; # Set up a reference cycle with an easy-to-find PV in it # Run this from an anonymous sub so we know the lexical is dropped === modified file 't/10tool-sizes.t' --- t/10tool-sizes.t 2013-12-04 22:33:38 +0000 +++ t/10tool-sizes.t 2018-08-11 15:30:41 +0000 @@ -8,7 +8,7 @@ use Devel::MAT::Dumper; use Devel::MAT; -my $DUMPFILE = "test.pmat"; +my $DUMPFILE = __FILE__ =~ s/\.t/\.pmat/r; our $EMPTY_SVIV = 123; our @EMPTY_AV = ();
CC: ANDK [...] cpan.org
Subject: Re: [rt.cpan.org #126041] Fails with HARNESS_OPTIONS=j2
Date: Sat, 11 Aug 2018 20:10:44 +0200
To: "Paul Evans via RT" <bug-Devel-MAT [...] rt.cpan.org>
From: Andreas Koenig <andreas.koenig.7os6VVqR [...] franz.ak.mind.de>
Show quoted text
>>>>> On Sat, 11 Aug 2018 11:32:09 -0400, "Paul Evans via RT" <bug-Devel-MAT@rt.cpan.org> said:
Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=126041 > > Attached is a better patch, which also fixes the inrefs one.
Very nice, much better! -- andreas