Skip Menu |

This queue is for tickets about the DBIx-Class-Schema-Config CPAN distribution.

Report information
The Basics
Id: 83309
Status: resolved
Priority: 0/
Queue: DBIx-Class-Schema-Config

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

Bug Information
Severity: Normal
Broken in: 0.001008
Fixed in: (no value)



Subject: >=5.17 Hash randomization breaks 02_load_credential.t

Perl 5.17 has changes in it scheduled for 5.18 that mean hash-ordering is not consistent between runs any more.

Fixing the hash seed on a known good value gives repeatable good output, and likewise, fixing it on a known bad value gives repeatable bad output, which hints that this bug may be indirectly caused by it in some way.

I would have tried to explain what is going wrong in further detail, but I can't really understand why its failing either.

There seem to be 4 cases, 1 good, 3 bad, at least, running lots of times with PERL_HASH_SEED_DEBUG=1 only seemed to give me one of 4 outputs, and I found a short seed for each case I observed happening.  There might be other cases, but these are the ones I've got, and I'm hoping it will be useful enough for you to diagnose what is going wrong. 
 

 PERL_HASH_SEED=0x1 prove -qlr t/02_load_credentials.t
t/02_load_credentials.t .. ok   
All tests successful.
Files=1, Tests=6,  0 wallclock secs ( 0.01 usr  0.00 sys +  0.06 cusr  0.00 csys =  0.07 CPU)
Result: PASS

PERL_HASH_SEED=0x3 prove -qlr t/02_load_credentials.t
t/02_load_credentials.t .. 1/?
#   Failed test 'Get DB info from hashref.'
#   at t/02_load_credentials.t line 110.
#     Structures begin differing at:
#          $got->{user} = 'YawnyPants'
#     $expected->{user} = 'MyUser'
#   Failed test 'Get DB info from array.'
#   at t/02_load_credentials.t line 110.
#     Structures begin differing at:
#          $got->{user} = 'YawnyPants'
#     $expected->{user} = 'MyUser'
# Looks like you failed 2 tests of 6.
t/02_load_credentials.t .. Dubious, test returned 2 (wstat 512, 0x200)
Failed 2/6 subtests
Test Summary Report
-------------------
t/02_load_credentials.t (Wstat: 512 Tests: 6 Failed: 2)
 Failed tests:  1-2
 Non-zero exit status: 2

 

PERL_HASH_SEED=0x8 prove -qlr t/02_load_credentials.t
t/02_load_credentials.t .. 1/? 
Show quoted text

#   Failed test 'Get DB info from hashref.'
#   at t/02_load_credentials.t line 110.
#     Structures begin differing at:
#          $got->{pass} = 'WhyDoYouHateUs?'
#     $expected->{pass} = 'MyPass'
#   Failed test 'Get DB info from array.'
#   at t/02_load_credentials.t line 110.
#     Structures begin differing at:
#          $got->{pass} = 'WhyDoYouHateUs?'
#     $expected->{pass} = 'MyPass'
# Looks like you failed 2 tests of 6.
t/02_load_credentials.t .. Dubious, test returned 2 (wstat 512, 0x200)
Failed 2/6 subtests 

PERL_HASH_SEED=0x11 prove -qlr t/02_load_credentials.t 
t/02_load_credentials.t .. 1/? 
#   Failed test 'Get DB info from hashref.'
#   at t/02_load_credentials.t line 110.
#     Structures begin differing at:
#          $got->{dsn} = 'dbi:mysql:dbname=acronym'
#     $expected->{dsn} = 'dbi:SQLite:dbfile=:memory:'
#   Failed test 'Get DB info from array.'
#   at t/02_load_credentials.t line 110.
#     Structures begin differing at:
#          $got->{dsn} = 'dbi:mysql:dbname=acronym'
#     $expected->{dsn} = 'dbi:SQLite:dbfile=:memory:'
# Looks like you failed 2 tests of 6.
t/02_load_credentials.t .. Dubious, test returned 2 (wstat 512, 0x200)
Failed 2/6 subtests 
 
Test Summary Report
-------------------
t/02_load_credentials.t (Wstat: 512 Tests: 6 Failed: 2)
  Failed tests:  1-2
  Non-zero exit status: 2
Files=1, Tests=6,  0 wallclock secs ( 0.02 usr  0.01 sys +  0.05 cusr  0.01 csys =  0.09 CPU)
Result: FAIL
 

 

Subject: [cpan #83309] [PATCH] Fix perl 5.17 hash randomisation breakage
Date: Sat, 16 Feb 2013 19:26:44 +0100
To: bug-DBIx-Class-Schema-Config [...] rt.cpan.org
From: ilmari [...] ilmari.org (Dagfinn Ilmari Mannsåker)
Here's a patch fixing the breakage.
From 38d2fd86f8ebb2f2fb838b67f1046b25ece6fde3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dagfinn=20Ilmari=20Manns=C3=A5ker?= <ilmari@ilmari.org> Date: Sat, 16 Feb 2013 18:19:30 +0000 Subject: [PATCH] Fix perl 5.17 hash randomisation breakage (RT#83309) Config::Any returns a list of separate hashes per file, each with a single key indicating the file name, so make the mock conform to the same API. --- Changes | 2 ++ t/02_load_credentials.t | 2 ++ 2 files changed, 4 insertions(+) diff --git a/Changes b/Changes index eb8ca80..e097aee 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,5 @@ + - Fix perl 5.17 hash randomisation breakage (RT#83309) + 0.1.8 - Added class accessor config_files to use Config::Any's load_files method and reduce stat() calls for those who diff --git a/t/02_load_credentials.t b/t/02_load_credentials.t index 291c7b9..cc8e895 100644 --- a/t/02_load_credentials.t +++ b/t/02_load_credentials.t @@ -28,6 +28,8 @@ Test::MockObject->fake_module( TRACE_LEVEL => 5, } }, + }, + { 'some_other_file' => { SOME_DATABASE => { dsn => 'dbi:mysql:dbname=acronym', -- 1.7.10.4
-- - Twitter seems more influential [than blogs] in the 'gets reported in the mainstream press' sense at least. - Matt McLeod - That'd be because the content of a tweet is easier to condense down to a mainstream media article. - Calle Dybedahl
Fixed in 0.1.9 Diff: https://github.com/symkat/DBIx-Class-Schema- Config/commit/d7fe7e43ace8cb7e8770bfc17f667ba945d5eba6 Thanks!