Skip Menu |

This queue is for tickets about the API-Plesk CPAN distribution.

Report information
The Basics
Id: 81603
Status: open
Priority: 0/
Queue: API-Plesk

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

Bug Information
Severity: Important
Broken in:
  • 2.01
  • 2.03
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 tests t/plesk.t t/service-plan.t t/site.t t/webspace.t are hit by that. Find a sample fail report at: http://www.cpantesters.org/cpan/report/f5f0737c-3290-11e2-9902-cf99a290f8f5 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,
On 2012-12-01 03:40:16, 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 > tests > > t/plesk.t > t/service-plan.t > t/site.t > t/webspace.t > > are hit by that. Find a sample fail report at: > > http://www.cpantesters.org/cpan/report/f5f0737c-3290-11e2-9902- > cf99a290f8f5 > > 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.
It looks like it still happens in version 2.03. Regards, Slaven
Thanks. Seems i should try to reproduce it on my local computer. Пнд Авг 19 04:26:34 2013, SREZIC писал: Show quoted text
> On 2012-12-01 03:40:16, 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 > > tests > > > > t/plesk.t > > t/service-plan.t > > t/site.t > > t/webspace.t > > > > are hit by that. Find a sample fail report at: > > > > http://www.cpantesters.org/cpan/report/f5f0737c-3290-11e2-9902- > > cf99a290f8f5 > > > > 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.
> > It looks like it still happens in version 2.03. > > Regards, > Slaven
From: reinpost [...] win.tue.nl
This issue still exists with current Perl on Ubuntu 14.04. Attached is a build.log obtained with the environment variable GZIP set to -9. After unsetting that variable, all tests and the installation succeed.
Subject: build.log
Download build.log
application/octet-stream 3.6k

Message body not shown because it is not plain text.

From: reinpost [...] win.tue.nl
This is not due to bad tests, it is an actual bug in the code, and a severe one. When running the code example in the API::Plesk perldoc, about 1/3 of the attempts fail due to the API request putting the <filter/> and <dataset/> elements in the wrong order! An attempted fix is attached; that example code runs for me now, but the tests fail due to datatype changes from HASH to ARRAY and I'm not sure the author will accept this way of fixing the problem, if it is correct at all (I'm totally new to this code and to the Plesk API).
Subject: API-Plesk-fix-for-81603.diff-Nurd
Download API-Plesk-fix-for-81603.diff-Nurd
application/octet-stream 5.2k

Message body not shown because it is not plain text.

From: reinpost [...] win.tue.nl
An alternative fix. Once again, untested. This one is less intrusive in that all hashes stay hashes, but it introduces a dependency on Tie::IxHash.
Subject: API-Plesk-fix-for-81603-w-IxHash.diff-Nurd

Message body not shown because it is not plain text.

From: reinpost [...] win.tue.nl
(I did test it on the example code.)
On https://github.com/regru/API-Plesk there is a version that calls itself 2.04 (the latest CPAN version is 2.03) and it does have a few new methods and such, but it has the same problem. (Testing with Perl 5.26 right now.)
There is a much simpler fix (I'm still getting to know this codebase), attached, and also committed to the fork in https://github.com/reinierpost/API-Plesk.git, which is based on another fork, and has some other fixes. This module is clearly abandonware. It would be great if someone can pick it up; I'm probably not going to do it.
Subject: API-Plesk-fix-for-81603-reorder-request.patch
diff --git a/lib/API/Plesk.pm b/lib/API/Plesk.pm index 9cc7c04..d10ec22 100644 --- a/lib/API/Plesk.pm +++ b/lib/API/Plesk.pm @@ -150,22 +150,6 @@ sub render_xml { $xml; } -my @xml_tags = qw(filter dataset); -my %xml_tag_order = map { $xml_tags[$_] => $_ } (0 .. $#xml_tags); - -# sorts hash keys by their XML schema order -sub by_tag_order { - for (($a, $b)) - { - if (!exists $xml_tag_order{$_}) - { - confess "BUG: do not know how to order tag $_" - } - } - - $xml_tag_order{$a} <=> $xml_tag_order{$b} -} - # renders xml from hash sub _render_xml { my ( $hash ) = @_; @@ -174,7 +158,7 @@ sub _render_xml { my $xml = ''; - for my $tag ( sort by_tag_order keys %$hash ) { + for my $tag ( keys %$hash ) { my $value = $hash->{$tag}; if ( ref $value eq 'HASH' ) { $value = _render_xml($value);