Skip Menu |

This queue is for tickets about the cPanel-SyncUtil CPAN distribution.

Report information
The Basics
Id: 81625
Status: resolved
Priority: 0/
Queue: cPanel-SyncUtil

People
Owner: cpan [...] cpanel.net
Requestors: ANDK [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.7
Fixed in: 0.8



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/cPanel-SyncUtil.t is hit by that. Find a sample fail report at: http://www.cpantesters.org/cpan/report/ddfbdc96-31e3-11e2-8853-59a3a290f8f5 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 a fail. HTH&&Thanks&&Regards,
suggested patch diff --git a/modules/cPanel-SyncUtil/cPanel-SyncUtil/lib/cPanel/SyncUtil.pm b/modules/cPanel-SyncUtil/cPanel-SyncUtil/lib/cPanel/SyncUtil.pm index 4d9a207..4a89dcd 100644 --- a/modules/cPanel-SyncUtil/cPanel-SyncUtil/lib/cPanel/SyncUtil.pm +++ b/modules/cPanel-SyncUtil/cPanel-SyncUtil/lib/cPanel/SyncUtil.pm @@ -72,13 +72,13 @@ sub _read_dir { goto &File::Slurp::read_dir; } # has varying meta data (mode, target, etc) so length and name are pidgy, # not critical for operation as the point of sort holds its integrity my $sort_cpanelsync_entries = sub { - substr($a,0,1) cmp substr($b,0,1) || length($a) <=> length($b) || uc($a) cmp uc($b) + substr($a,0,1) cmp substr($b,0,1) || length($a) <=> length($b) || uc($a) cmp uc($b) || $a cmp $b }; my %type; my $sort_readdir = sub { $type{$a} ||= (-l $a ? 'l' : (-d $a ? 'd' : 'f')); $type{$b} ||= (-l $b ? 'l' : (-d $b ? 'd' : 'f')); - $type{$a} cmp $type{$b} || length($a) <=> length($b) || uc($a) cmp uc($b) + $type{$a} cmp $type{$b} || length($a) <=> length($b) || uc($a) cmp uc($b) || $a cmp $b }; sub __sort_test { On Sat Dec 01 23:31:54 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/cPanel-SyncUtil.t > > is hit by that. Find a sample fail report at: > > http://www.cpantesters.org/cpan/report/ddfbdc96-31e3-11e2-8853- > 59a3a290f8f5 > > 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 a fail. > > HTH&&Thanks&&Regards,
thanks! On Tue Aug 12 15:04:55 2014, atoomic wrote: Show quoted text
> suggested patch > > diff --git a/modules/cPanel-SyncUtil/cPanel- > SyncUtil/lib/cPanel/SyncUtil.pm b/modules/cPanel-SyncUtil/cPanel- > SyncUtil/lib/cPanel/SyncUtil.pm > index 4d9a207..4a89dcd 100644 > --- a/modules/cPanel-SyncUtil/cPanel-SyncUtil/lib/cPanel/SyncUtil.pm > +++ b/modules/cPanel-SyncUtil/cPanel-SyncUtil/lib/cPanel/SyncUtil.pm > @@ -72,13 +72,13 @@ sub _read_dir { goto &File::Slurp::read_dir; } > # has varying meta data (mode, target, etc) so length and name are > pidgy, > # not critical for operation as the point of sort holds its > integrity > my $sort_cpanelsync_entries = sub { > - substr($a,0,1) cmp substr($b,0,1) || length($a) <=> length($b) || > uc($a) cmp uc($b) > + substr($a,0,1) cmp substr($b,0,1) || length($a) <=> length($b) || > uc($a) cmp uc($b) || $a cmp $b > }; > my %type; > my $sort_readdir = sub { > $type{$a} ||= (-l $a ? 'l' : (-d $a ? 'd' : 'f')); > $type{$b} ||= (-l $b ? 'l' : (-d $b ? 'd' : 'f')); > - $type{$a} cmp $type{$b} || length($a) <=> length($b) || uc($a) > cmp uc($b) > + $type{$a} cmp $type{$b} || length($a) <=> length($b) || uc($a) > cmp uc($b) || $a cmp $b > }; > > sub __sort_test { > > On Sat Dec 01 23:31:54 2012, ANDK wrote:
> > 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/cPanel-SyncUtil.t > > > > is hit by that. Find a sample fail report at: > > > > http://www.cpantesters.org/cpan/report/ddfbdc96-31e3-11e2-8853- > > 59a3a290f8f5 > > > > 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 a fail. > > > > HTH&&Thanks&&Regards,