Skip Menu |

This queue is for tickets about the HTTP-Server-Simple CPAN distribution.

Report information
The Basics
Id: 38011
Status: resolved
Priority: 0/
Queue: HTTP-Server-Simple

People
Owner: Nobody in particular
Requestors: david.sitsky [...] gmail.com
Cc:
AdminCc:

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



Subject: Tests hang on Windows XP with Strawberry Perl 5.10.0.1
Date: Tue, 29 Jul 2008 21:04:44 +1000
To: bug-HTTP-Server-Simple [...] rt.cpan.org
From: "David Sitsky" <david.sitsky [...] gmail.com>
I am trying to install Catalyst on a Windows XP machine with Strawberry Perl 5.10.0.1. Unfortunately the tests seem to hang in the same spot - here is the relevant output. Is there anything I can do to get this working? C:\work\catalyst>perl -MCPAN -e "install HTTP::Server::Simple" CPAN: File::HomeDir loaded ok (v0.69) Database was generated on Tue, 29 Jul 2008 09:52:16 GMT Running install for module 'HTTP::Server::Simple' Running make for J/JE/JESSE/HTTP-Server-Simple-0.34.tar.gz Checksum for C:\strawberry\cpan\sources\authors\id\J\JE\JESSE\HTTP-Server-Simple -0.34.tar.gz ok CPAN.pm: Going to build J/JE/JESSE/HTTP-Server-Simple-0.34.tar.gz Checking if your kit is complete... Looks good Writing Makefile for HTTP::Server::Simple cp lib/HTTP/Server/Simple/CGI/Environment.pm blib\lib\HTTP\Server\Simple\CGI\Env ironment.pm cp lib/HTTP/Server/Simple.pm blib\lib\HTTP\Server\Simple.pm cp lib/HTTP/Server/Simple/CGI.pm blib\lib\HTTP\Server\Simple\CGI.pm JESSE/HTTP-Server-Simple-0.34.tar.gz C:\strawberry\c\bin\dmake.EXE -- OK Running make test C:\strawberry\perl\bin\perl.exe "-MExtUtils::Command::MM" "-e" "test_harness(0, 'inc', 'blib\lib', 'blib\arch')" t/*.t t/00smoke............ok t/01live.............6/14 Cheers, David
Also having this problem. Here I'm unable to force install because I'm trying to build a Strawberry perl distribution with Catalyst and tools all included. I have a little time to help with fixing this, but need some guidance.
On Fri Nov 21 18:18:15 2008, ZARQUON wrote: Show quoted text
> Also having this problem. Here I'm unable to force install because I'm > trying to build a Strawberry perl distribution with Catalyst and tools > all included. > > I have a little time to help with fixing this, but need some guidance.
Here's a fix that gets around the problem by skipping the SlowServer tests on windows. I did find something that might be a workaround for this issue at http://samdelacruz.blogspot.com/2007/02/kill-processes-in-windows.html, but I lack the expertise to assess it, and it does seem awfully long and cumbersome for a bug that will be amply tested on other platforms anyway.
--- 01live.t 2008-11-22 19:33:02.000000000 +1100 +++ 01live.t_new 2008-11-22 19:33:26.000000000 +1100 @@ -34,10 +34,12 @@ } -TODO: { - local $TODO = "We don't currently wait for 'server is running' responses from the client"; - run_server_tests('SlowServer'); - + TODO: { + local $TODO = "We don't currently wait for 'server is running' responses from the client"; + SKIP: { + skip "SlowServer tests don't work on win32 because the CORE::kill() is subtly broken", 4 if $^O = 'MSWin32'; + run_server_tests('SlowServer'); + } }
On Tue Jul 29 07:05:53 2008, david.sitsky@gmail.com wrote: Show quoted text
> I am trying to install Catalyst on a Windows XP machine with > Strawberry Perl 5.10.0.1. > > Unfortunately the tests seem to hang in the same spot - here is the > relevant output. Is there anything I can do to get this working? > > C:\work\catalyst>perl -MCPAN -e "install HTTP::Server::Simple" > CPAN: File::HomeDir loaded ok (v0.69) > Database was generated on Tue, 29 Jul 2008 09:52:16 GMT > Running install for module 'HTTP::Server::Simple' > Running make for J/JE/JESSE/HTTP-Server-Simple-0.34.tar.gz > Checksum for C:\strawberry\cpan\sources\authors\id\J\JE\JESSE\HTTP- > Server-Simple > -0.34.tar.gz ok > > CPAN.pm: Going to build J/JE/JESSE/HTTP-Server-Simple-0.34.tar.gz > > Checking if your kit is complete... > Looks good > Writing Makefile for HTTP::Server::Simple > cp lib/HTTP/Server/Simple/CGI/Environment.pm > blib\lib\HTTP\Server\Simple\CGI\Env > ironment.pm > cp lib/HTTP/Server/Simple.pm blib\lib\HTTP\Server\Simple.pm > cp lib/HTTP/Server/Simple/CGI.pm blib\lib\HTTP\Server\Simple\CGI.pm > JESSE/HTTP-Server-Simple-0.34.tar.gz > C:\strawberry\c\bin\dmake.EXE -- OK > Running make test > C:\strawberry\perl\bin\perl.exe "-MExtUtils::Command::MM" "-e" > "test_harness(0, > 'inc', 'blib\lib', 'blib\arch')" t/*.t > t/00smoke............ok > t/01live.............6/14 >
I'm seeing similar problems on Win32 with 5.8.9-RC1, but have not yet determined whether this is a regression or not from 5.8.8. Steve Peters
CC: undisclosed-recipients: ;
Subject: Re: [rt.cpan.org #38011] Tests hang on Windows XP with Strawberry Perl 5.10.0.1
Date: Fri, 28 Nov 2008 12:39:31 -0500
To: Steve Peters via RT <bug-HTTP-Server-Simple [...] rt.cpan.org>
From: Jesse Vincent <jesse [...] fsck.com>
Steve, Have you managed to figure out if it's failing this way on 5.8.8 as well? Jesse
Download (untitled)
application/pgp-signature 194b

Message body not shown because it is not plain text.

From: raherh [...] gmail.com
On Tue Jul 29 07:05:53 2008, david.sitsky@gmail.com wrote: Show quoted text
> I am trying to install Catalyst on a Windows XP machine with > Strawberry Perl 5.10.0.1. > > Unfortunately the tests seem to hang in the same spot - here is the > relevant output. Is there anything I can do to get this working?
I tried to fix the tests (01live.t, 04cgi.t) to pass on Windows with perl 5.10.0. The 01live test hangs because the server is not ready for fetching. Therefore the waiting time is increased to 3 sec. The SlowServer part of test fails only occasionaly: it uses the same port as the previous one. When the port is different, it's ok, so the port number is increased by 1. The 04cgi fixed test uses the same waiting time (3 sec) after starting. #20 and #21 use http 0.9 and this protocol fails every time so I changed the proto to http 1.0. Don't know why the server doesn't accept this protocol. Both patches are included. Radek
--- 04cgi.t 2008-03-20 19:18:00.000000000 +0000 +++ 04cgi.new 2008-12-27 13:32:48.250270400 +0000 @@ -1,3 +1,5 @@ +# -*- perl -*- + use Test::More; use Socket; use strict; @@ -38,7 +40,7 @@ like($pid, '/^-?\d+$/', 'pid is numeric'); - select(undef,undef,undef,0.2); # wait a sec + sleep 3; # wait a sec like(fetch("GET / HTTP/1.1",""), '/NOFILE/', 'no file'); foreach my $method (keys(%methods)) { @@ -60,13 +62,13 @@ } like( - fetch("GET /cgitest/REQUEST_URI?foo%3Fbar",""), + fetch("GET /cgitest/REQUEST_URI?foo%3Fbar HTTP/1.0",""), qr/foo%3Fbar/, "Didn't decode already" ); like( - fetch("GET /cgitest/foo%2Fbar/PATH_INFO",""), + fetch("GET /cgitest/foo%2Fbar/PATH_INFO HTTP/1.0",""), qr|foo/bar|, "Did decode already" );
--- 01live.t 2008-06-05 21:41:15.000000000 +0000 +++ 01live.new 2008-12-27 13:33:13.166097600 +0000 @@ -140,11 +140,12 @@ sub run_server_tests { my $class = shift; + $PORT += 1 if $class eq 'SlowServer'; my $s = $class->new($PORT); is($s->port(),$PORT,"Constructor set port correctly"); my $pid=$s->background(); - select(undef,undef,undef,0.2); # wait a sec + sleep 3; # wait a sec like($pid, '/^-?\d+$/', 'pid is numeric');
[snip] Show quoted text
> I tried to fix the tests (01live.t, 04cgi.t) to pass on Windows with > perl 5.10.0. > > The 01live test hangs because the server is not ready for fetching. > Therefore the waiting time is increased to 3 sec. > The SlowServer part of test fails only occasionaly: it uses the same > port as the previous one. When the port is different, it's ok, so the > port number is increased by 1. > > The 04cgi fixed test uses the same waiting time (3 sec) after starting. > #20 and #21 use http 0.9 and this protocol fails every time so I > changed the proto to http 1.0. Don't know why the server doesn't accept > this protocol.
[snip] There is mention of this issue on one or more of the other open bug reports. I am seeing the same problem on linux/perl 5.8.8. I found that the attached one-line patch fixes the failures in 01live.t, at least running on my ancient laptop.
diff --git a/t/01live.t b/t/01live.t index 78593f4..74bebd4 100644 --- a/t/01live.t +++ b/t/01live.t @@ -20,8 +20,8 @@ package SlowServer; use base qw(HTTP::Server::Simple::CGI); sub setup_listener { my $self = shift; - sleep 2; $self->SUPER::setup_listener(); + sleep 2; } 1; package main;
CC: undisclosed-recipients: ;
Subject: Re: [rt.cpan.org #38011] Tests hang on Windows XP with Strawberry Perl 5.10.0.1
Date: Fri, 2 Jan 2009 12:10:11 -0500
To: "gyles19 [...] visi.com via RT" <bug-HTTP-Server-Simple [...] rt.cpan.org>
From: Jesse Vincent <jesse [...] fsck.com>
Gyles, Thanks, applied. On Wed 31.Dec'08 at 16:04:45 -0500, gyles19@visi.com via RT wrote: Show quoted text
> Queue: HTTP-Server-Simple > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=38011 > > > [snip]
> > I tried to fix the tests (01live.t, 04cgi.t) to pass on Windows with > > perl 5.10.0. > > > > The 01live test hangs because the server is not ready for fetching. > > Therefore the waiting time is increased to 3 sec. > > The SlowServer part of test fails only occasionaly: it uses the same > > port as the previous one. When the port is different, it's ok, so the > > port number is increased by 1. > > > > The 04cgi fixed test uses the same waiting time (3 sec) after starting. > > #20 and #21 use http 0.9 and this protocol fails every time so I > > changed the proto to http 1.0. Don't know why the server doesn't accept > > this protocol.
> [snip] > > There is mention of this issue on one or more of the other open bug reports. > I am seeing the same problem on linux/perl 5.8.8. I found that the > attached one-line patch fixes the failures in 01live.t, at least running > on my ancient laptop. > >
--
Download (untitled)
application/pgp-signature 194b

Message body not shown because it is not plain text.

CC: undisclosed-recipients: ;
Subject: Re: [rt.cpan.org #38011] Tests hang on Windows XP with Strawberry Perl 5.10.0.1
Date: Fri, 2 Jan 2009 12:18:42 -0500
To: Radek via RT <bug-HTTP-Server-Simple [...] rt.cpan.org>
From: Jesse Vincent <jesse [...] fsck.com>
On Sat 27.Dec'08 at 9:37:45 -0500, Radek via RT wrote: Show quoted text
> Queue: HTTP-Server-Simple > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=38011 > > > On Tue Jul 29 07:05:53 2008, david.sitsky@gmail.com wrote:
> > I am trying to install Catalyst on a Windows XP machine with > > Strawberry Perl 5.10.0.1. > > > > Unfortunately the tests seem to hang in the same spot - here is the > > relevant output. Is there anything I can do to get this working?
> > I tried to fix the tests (01live.t, 04cgi.t) to pass on Windows with > perl 5.10.0. > > The 01live test hangs because the server is not ready for fetching. > Therefore the waiting time is increased to 3 sec. > The SlowServer part of test fails only occasionaly: it uses the same > port as the previous one. When the port is different, it's ok, so the > port number is increased by 1.
Ok. Applied Show quoted text
> The 04cgi fixed test uses the same waiting time (3 sec) after starting.
Applied, even though it makes me a little nervous that we need to. Show quoted text
> #20 and #21 use http 0.9 and this protocol fails every time so I > changed the proto to http 1.0. Don't know why the server doesn't accept > this protocol.
The server sure should be accepting this protocol. Rather than changing the tests to accept the broken behaviour, I'd hugely appreciate some triage to find the server bug ;) (It passes for me); Show quoted text
> > Both patches are included. > > Radek > > > > > >
--
Download (untitled)
application/pgp-signature 194b

Message body not shown because it is not plain text.

RT-Send-CC: jesse [...] fsck.com
On Fri Jan 02 12:18:48 2009, jesse@fsck.com wrote: Show quoted text
> > The 04cgi fixed test uses the same waiting time (3 sec) after
starting. Show quoted text
> > Applied, even though it makes me a little nervous that we need to.
Now even without any waiting time it's ok. Don't know. Show quoted text
> The server sure should be accepting this protocol. Rather than
changing Show quoted text
> the tests to accept the broken behaviour, I'd hugely appreciate some > triage to find the server bug ;) (It passes for me);
When fetching with 0.9 protocol the line should read: fetch("GET /cgitest/REQUEST_URI?foo%3Fbar"), not fetch("GET /cgitest/REQUEST_URI?foo%3Fbar","") and the same for: fetch("GET /cgitest/foo%2Fbar/PATH_INFO"). The second parameter is intended for optional entity-body with http 1.0 and should be missing for http 0.9. The message is being composed like this: $message = join "", map { "$_\015\012" } @_; So there's another obligatory crlf for http 1.0. I think simple-response (http 0.9) should follow the rf1945 and send back only entity-body without any headers though it doesn't affect tests. It's being used with H::S::S in bad_request, H::S::S::CGI in bundle_request and in handle_request of package CGIServer with 04cgi.t where it could be something along these lines: my $file=(split('/',$cgi->path_info))[-1]||'NOFILE'; $file=~s/\s+//g; $file||='NOFILE'; my $proto = (split('/',$cgi->server_protocol))[1]||1.0; print "HTTP/1.0 200 OK\r\n" if $proto >= 1; print "Content-Type: text/html\r\nContent-Length: " if $proto >= 1; my $response; if($methods{$file}) { $response = "$file: ".$cgi->$file(); } elsif($envvars{$file}) { $response="$file: $ENV{$file}"; } else { $response=$file; } print length($response), "\r\n\r\n" if $proto >= 1; print $response; } htp Radek
I'm not seeing hangs from the smokers on more modern strawberry perls, please reopen if you still see the failures. -kevin