Skip Menu |

This queue is for tickets about the SOAP-Lite CPAN distribution.

Report information
The Basics
Id: 84168
Status: resolved
Priority: 0/
Queue: SOAP-Lite

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

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



Subject: Test t/02-payload.t fails under Perl 5.17.10
The failure is in test 37, map type serialization/deserialization. There is not, I think, anything wrong with SOAP::Lite itself; the problem appears to be that the test assumes that if two hashes contain the same data, iteration over them will produce the keys in the same order. This assumption fails under 5.17.10, due to a change made for security reasons (see perldelta for that release). It is possible to make the test pass by changing 'keys' to 'sort keys' in methods tag() and map() in SOAP::Serializer, but I am not sure this is the right solution -- and if it is, there are surely more changes that need to be made. A better change would probably be to compare the DOMs rather than their serialized representation, but this seems to involve (at least) converting to Test::More. I have attached a patch which is really more in the nature of a Band-Aid, which marks the failing test as TODO if the Perl version is 5.017010 or higher.
Subject: SOAP-Lite-02-payload.patch
--- t/02-payload.old 2012-06-25 16:13:34.000000000 -0400 +++ t/02-payload.t 2013-03-23 15:20:19.000000000 -0400 @@ -10,7 +10,12 @@ use strict; use Test; -BEGIN { plan tests => 131 } +BEGIN { + my @todo; + $] >= 5.017010 + and push @todo, 37; + plan tests => 131, todo => \@todo; +} use SOAP::Lite; $SIG{__WARN__} = sub { ; }; # turn off deprecation warnings
Resolved in 0.716. Thanks for the patch!
The test still fails with 5.18: # Failed test 39 in t/02-payload.t at line 260 # t/02-payload.t line 260 is: ok($implicit eq $serialized); t/02-payload.t ............................... Failed 1/133 subtests (1 TODO test unexpectedly succeeded)
On Wed Jun 05 13:23:49 2013, GREGOA wrote: Show quoted text
> The test still fails with 5.18: > > # Failed test 39 in t/02-payload.t at line 260 > # t/02-payload.t line 260 is: ok($implicit eq $serialized); > t/02-payload.t ............................... > Failed 1/133 subtests > (1 TODO test unexpectedly succeeded)
Yeah. The original patch was a band-aid. I'm not sure the script doesn't slip extra tests in somewhere, since the 'todo' passes. It seems ridiculous to modify SOAP::Lite just to pass these tests, since the order of attributes is not significant, but the alternative is to completely rework the tests. I have attached the three patch files I currently use: SOAP-Lite.patch changes 'keys' to 'sort keys' in the two places it appears to be needed to make the XML generated for the test deterministic. SOAP-Lite-t-02-payload.patch retracts (more or less) my original patch. SOAP-Lite-t-04-attach.patch is the one I'm least certain of. On my system at least I get more tests than are planned, and the patch fixes this. I looked at the first 5 results in CPAN-Testers. In two this test failed because it ran more tests than planned. In the other three this test was skipped because MIME::Parser was not installed. So I _think_ this is a good patch.
Subject: SOAP-Lite-t-02-payload.patch
--- t/02-payload.old 2013-05-11 00:34:36.000000000 -0400 +++ t/02-payload.t 2013-05-21 13:57:05.000000000 -0400 @@ -12,8 +12,8 @@ BEGIN { my @todo; - $] >= 5.017010 - and push @todo, 37; +# $] >= 5.017010 +# and push @todo, 37; plan tests => 133, todo => \@todo; }
Subject: SOAP-Lite-t-04-attach.patch
--- t/04-attach.old 2013-05-11 00:44:37.000000000 -0400 +++ t/04-attach.t 2013-05-17 14:24:05.000000000 -0400 @@ -20,7 +20,7 @@ } } -BEGIN { plan tests => 15 } +BEGIN { plan tests => 18 } my ( $a, $soap, $d, $s, $r, $serialized, $deserialized );
Subject: SOAP-Lite.patch
--- lib/SOAP/Lite.old 2013-05-11 00:58:27.000000000 -0400 +++ lib/SOAP/Lite.pm 2013-05-21 14:07:40.000000000 -0400 @@ -1365,7 +1365,7 @@ ), 'item', '' - )} keys %$value; + )} sort keys %$value; return [ $name, {'xsi:type' => "$prefix:Map", %$attr}, @@ -1484,7 +1484,7 @@ my $tagattrs = join($tagjoiner, '', map { sprintf '%s="%s"', $_, SOAP::Utils::encode_attribute($attrs->{$_}) } grep { $_ && defined $attrs->{$_} && ($_ ne 'xsi:type' || $attrs->{$_} ne '') } - keys %$attrs); + sort keys %$attrs); if ($value gt '') { return sprintf("$prolog$indent<%s%s>%s%s</%s>$epilog",$tag,$tagattrs,$value,($value =~ /^\s*</ ? $indent : ""),$tag);
Still an issue with SOAP::Lite 1.0 under Perl 5.18. The patches have changed, though. Here's what is needed under SOAP::Lite 1.0. While I was patching lib/SOAP/Lite.pm, I went ahead and did a one-liner that suppresses the suppresses the subroutine redefinition warnings.
Subject: SOAP-Lite-t-02-payload.patch
--- t/02-payload.old 2013-05-11 00:34:36.000000000 -0400 +++ t/02-payload.t 2013-07-21 13:16:37.000000000 -0400 @@ -12,8 +12,8 @@ BEGIN { my @todo; - $] >= 5.017010 - and push @todo, 37; +# $] >= 5.017010 +# and push @todo, 37; plan tests => 133, todo => \@todo; }
Subject: SOAP-Lite.patch
--- lib/SOAP/Lite.old 2013-07-17 02:11:14.000000000 -0400 +++ lib/SOAP/Lite.pm 2013-07-21 13:27:05.000000000 -0400 @@ -1363,7 +1363,7 @@ ), 'item', '' - )} keys %$value; + )} sort keys %$value; return [ $name, {'xsi:type' => "$prefix:Map", %$attr}, @@ -1482,7 +1482,7 @@ my $tagattrs = join($tagjoiner, '', map { sprintf '%s="%s"', $_, SOAP::Utils::encode_attribute($attrs->{$_}) } grep { $_ && defined $attrs->{$_} && ($_ ne 'xsi:type' || $attrs->{$_} ne '') } - keys %$attrs); + sort keys %$attrs); if ($value gt '') { return sprintf("$prolog$indent<%s%s>%s%s</%s>$epilog",$tag,$tagattrs,$value,($value =~ /^\s*</ ? $indent : ""),$tag); @@ -2978,7 +2978,7 @@ $minus ? push(@notrace, $all ? @list : $_) : push(@symbols, $all ? @list : $_); } } - # TODO - I am getting a warning here about redefining a subroutine + no warnings qw{ redefine }; foreach (@symbols) { *$_ = \&defaultlog } foreach (@notrace) { *$_ = sub {} } }
Subject: Re: [rt.cpan.org #84168] Test t/02-payload.t fails under Perl 5.17.10
Date: Mon, 22 Jul 2013 20:07:13 -0700
To: bug-SOAP-Lite [...] rt.cpan.org
From: Fred Moyer <fred [...] redhotpenguin.com>
So no todo with perl > 5.17? --- a/t/02-payload.t +++ b/t/02-payload.t @@ -12,8 +12,8 @@ use Test; BEGIN { my @todo; - $] >= 5.017010 - and push @todo, 37; +# $] >= 5.017010 +# and push @todo, 37; plan tests => 133, todo => \@todo; On Sun, Jul 21, 2013 at 10:36 AM, Tom Wyant via RT <bug-SOAP-Lite@rt.cpan.org> wrote: Show quoted text
> Queue: SOAP-Lite > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=84168 > > > Still an issue with SOAP::Lite 1.0 under Perl 5.18. The patches have changed, though. Here's what is needed under SOAP::Lite 1.0. > > While I was patching lib/SOAP/Lite.pm, I went ahead and did a one-liner that suppresses the suppresses the subroutine redefinition warnings.
On Mon Jul 22 23:07:26 2013, fred@redhotpenguin.com wrote: Show quoted text
> So no todo with perl > 5.17? >
Yes, no TODO. That was a band-aid, and it appears that it makes the wrong test TODO anyway. Sorry about that. The patch just patches it out, but feel free to revert the change that installed it in the first place.
Subject: Re: [rt.cpan.org #84168] Test t/02-payload.t fails under Perl 5.17.10
Date: Tue, 23 Jul 2013 09:50:51 -0700
To: bug-SOAP-Lite [...] rt.cpan.org
From: Fred Moyer <fred [...] redhotpenguin.com>
Ok if I remove the Todo entirely then? Sorry if I'm being dense, just want to make sure. On Tue, Jul 23, 2013 at 9:49 AM, Tom Wyant via RT <bug-SOAP-Lite@rt.cpan.org> wrote: Show quoted text
> Queue: SOAP-Lite > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=84168 > > > On Mon Jul 22 23:07:26 2013, fred@redhotpenguin.com wrote:
>> So no todo with perl > 5.17? >>
> > Yes, no TODO. That was a band-aid, and it appears that it makes the wrong test TODO anyway. Sorry about that. The patch just patches it out, but feel free to revert the change that installed it in the first place.
On Tue Jul 23 12:51:04 2013, fred@redhotpenguin.com wrote: Show quoted text
> Ok if I remove the Todo entirely then? Sorry if I'm being dense, just > want to make sure. >
Yes, it's OK with me if you remove the TODO entirely, given the two 'sort keys' inserted in SOAP::Lite by a subsequent patch. Maybe a purist would have worked out a way to have the test pass without changing SOAP::Lite, but I was not that smart. Don't worry about the request for confirmation. The greatest danger of communication is the illusion that it has occurred. Thanks, Tom
Subject: Re: [rt.cpan.org #84168] Test t/02-payload.t fails under Perl 5.17.10
Date: Tue, 23 Jul 2013 10:07:59 -0700
To: bug-SOAP-Lite [...] rt.cpan.org
From: Fred Moyer <fred [...] redhotpenguin.com>
Ok sounds good. 1.01 coming tonight. On Tue, Jul 23, 2013 at 10:05 AM, Tom Wyant via RT <bug-SOAP-Lite@rt.cpan.org> wrote: Show quoted text
> Queue: SOAP-Lite > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=84168 > > > On Tue Jul 23 12:51:04 2013, fred@redhotpenguin.com wrote:
>> Ok if I remove the Todo entirely then? Sorry if I'm being dense, just >> want to make sure. >>
> > Yes, it's OK with me if you remove the TODO entirely, given the two 'sort keys' inserted in SOAP::Lite by a subsequent patch. Maybe a purist would have worked out a way to have the test pass without changing SOAP::Lite, but I was not that smart. > > Don't worry about the request for confirmation. The greatest danger of communication is the illusion that it has occurred. > > Thanks, > Tom
resolved in 1.01