Skip Menu |

This queue is for tickets about the Scrappy CPAN distribution.

Report information
The Basics
Id: 82142
Status: open
Priority: 0/
Queue: Scrappy

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

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



Subject: Test failures due to hash randomisation in perl 5.17.6
Since bleadperl v5.17.5-518-g7dc8663 your tests are failing frequently. That commit introduced hash key randomization and it seems at least the test t/00_load_scrappy.t is hit by that. Find a sample fail report at: http://www.cpantesters.org/cpan/report/b9c0d866-494b-11e2-8d86-527646f78928 You can read more about the change at http://perl5.git.perl.org/perl.git/commit/7dc8663964c66a698d31bbdc8e8abed69bddeec3 or at http://www.perlmonks.org/?node_id=1005122 You may have to run the test several times until the randomization causes booth a pass and a fail. HTH&&Thanks&&Regards,
Subject: [PATCH] Test failures due to hash randomisation in perl 5.17.6
On Thu Dec 20 15:45:20 2012, ANDK wrote: Show quoted text
> Since bleadperl v5.17.5-518-g7dc8663 your tests are failing > frequently. > That commit introduced hash key randomization and it seems at least > the test > > t/00_load_scrappy.t > > is hit by that.
Attaching the suggested fix.
Subject: 0001-Plugins-Call-initializers-in-correct-order.patch
From 5e1432319fee575367a2dafd788c134a0b8f9c24 Mon Sep 17 00:00:00 2001 From: Lubomir Rintel <lkundrak@v3.sk> Date: Tue, 6 May 2014 09:32:13 +0200 Subject: [PATCH] Plugins: Call initializers in correct order According to Class::MOP::Attribute manual: Note that there is no guarantee that attributes are initialized in any particular order, so you cannot rely on the value of some other attribute when generating the default. This is exactly what was being done, causing test failures ever since hash key order was randomized (RT#82142): Can't use an undefined value as an ARRAY reference at lib/Scrappy/Plugin.pm line 21. Let's just initialize plugins() lazily -- it will still be initialized upon the instance creation, since registry() will trigger it, just in the correct order now. --- lib/Scrappy/Plugin.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Scrappy/Plugin.pm b/lib/Scrappy/Plugin.pm index abda24f..4b8edbb 100644 --- a/lib/Scrappy/Plugin.pm +++ b/lib/Scrappy/Plugin.pm @@ -31,8 +31,10 @@ has registry => ( has plugins => ( is => 'ro', isa => 'Any', + # registry() uses us in their initializer, defer our own + # initialization until then + lazy => 1, default => sub { - my @plugins = (); # fix for bug found by Patrick Woo -- 2.0.0.rc0