Skip Menu |

This queue is for tickets about the Maypole CPAN distribution.

Report information
The Basics
Id: 11346
Status: resolved
Priority: 0/
Queue: Maypole

People
Owner: TEEJAY [...] cpan.org
Requestors: LTHEGLER [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 2.09
Fixed in: 2.11



Subject: t/cgi_maypole.t fails due to header order
In t/cgi_maypole.t, test 28 fails, apparently due to non-determinism of header order. The test should probably be recoded slightly to handle different sequences of header output. /Lars --cut-- [lth@dask2 Maypole-2.09]$ make test TEST_FILES=t/cgi_maypole.t TEST_VERBOSE=1 PERL_DL_NONLAZY=1 /usr/local/bin/perl5.6.2 "-MExtUtils::Command::MM" "-e" "test_harness(1, 'blib/lib', 'blib/arch')" t/cgi_maypole.t t/cgi_maypole....1..30 [...] not ok 28 - ... prints output, including custom headers # Failed test (t/cgi_maypole.t at line 115) # got: 'X-bender: kiss my shiny metal ass # Content-length: 12 # Content-Type: text/plain; charset=iso8859-1 # # Hello World!' # expected: 'Content-length: 12 # X-bender: kiss my shiny metal ass # Content-Type: text/plain; charset=iso8859-1 # # Hello World!' ok 29 - CGI::Maypole->can('get_template_root') ok 30 - ... catdir(document_root, [relative_url]) # Looks like you failed 1 test of 30. dubious Test returned status 1 (wstat 256, 0x100) DIED. FAILED test 28 Failed 1/30 tests, 96.67% okay Failed Test Stat Wstat Total Fail Failed List of Failed ------------------------------------------------------------------------------- t/cgi_maypole.t 1 256 30 1 3.33% 28 Failed 1/1 test scripts, 0.00% okay. 1/30 subtests failed, 96.67% okay. *** Error code 2 Stop in /usr/home/lth/cvs/ports/www/p5-Maypole/work/Maypole-2.09. [lth@dask2 Maypole-2.09]$ --cut--
[LTHEGLER - Wed Feb 2 14:58:17 2005]: Show quoted text
> In t/cgi_maypole.t, test 28 fails, apparently due to non-determinism > of header order. The test should probably be recoded slightly to > handle different sequences of header output. > --cut--
SimonF and I had some correspondence about this in January. Here's a message with a possible patch from me and Simon's reply. I don't know whether he ever did as he proposed. HTH, Dave ==== Hi Dave, thanks for the patch. I was thinking of patching it another way, either by sorting the headers in the captured output, or by sorting the headers as they are output by Maypole, since the Content-length header could also be output in a different order. Thanks Simon Dave Howorth wrote: Show quoted text
> Hi Simon, > > I still see the CGI test failure. Here's a patch for the test: > > > --- cgi_maypole.t.orig Tue Jan 25 22:06:59 2005 > +++ cgi_maypole.t Wed Jan 26 10:17:59 2005 > @@ -108,11 +108,13 @@ > }; > diag $@ if $@; > > - $compare = join "\cM\cJ", 'Content-length: 12', > - 'X-bender: kiss my shiny metal ass', > + my $CL = 'Content-length: 12'; > + my $XB = 'X-bender: kiss my shiny metal ass'; > + my $nl = "\cM\cJ"; > + my $compare = join $nl, "($CL$nl$XB)|($XB$nl$CL)", > 'Content-Type: text/plain; charset=iso8859-1', > '', 'Hello World!'; > - is($stdout, $compare, '... prints output, including custom headers'); > + like($stdout, qr/$re/, '... prints output, including custom
headers'); Show quoted text
> } > > # get_template_root() > > > Cheers, Dave
[DJH - Tue Aug 2 11:45:47 2005]: Show quoted text
> [LTHEGLER - Wed Feb 2 14:58:17 2005]:
> > In t/cgi_maypole.t, test 28 fails, apparently due to non-determinism > > of header order. The test should probably be recoded slightly to > > handle different sequences of header output. > > --cut--
> > SimonF and I had some correspondence about this in January. Here's a > message with a possible patch from me and Simon's reply. I don't know > whether he ever did as he proposed. >
I like that nice simple patch - it works for me so I'll update SVN