in reply to Re^2: Hoping for some beady eyes on my first CPAN submission
in thread Hoping for some beady eyes on my first CPAN submission

At the top of t/serving.t replace 'localhost' with '127.0.0.1' and see if that helps?

I wouldn't expect that to make any difference (and I don't think it did). And running both with and without the firewall activated produces the same output (AFAICT):
C:\_32\comp\HTTP-Server-Brick>perl -Mblib t\serving.t 1..59 ok 1 - use HTTP::Server::Brick; # # # Using port: 85432 and host: 127.0.0.1 for test server. # If these are not suitable settings on your machine, set the environm +ent # variables HSB_TEST_PORT and HSB_TEST_HOST to something suitable. # ok 2 - Created server object. ok 3 - The object isa HTTP::Server::Brick [Sun Jun 24 02:41:32 2007] [432] Mounted wildcard directory at /static +/test [Sun Jun 24 02:41:32 2007] [432] Mounted handler at /exotic_error [Sun Jun 24 02:41:32 2007] [432] Mounted handler at /another_exotic_er +ror [Sun Jun 24 02:41:32 2007] [432] Mounted handler at /static/test/more_ +specific_m ount [Sun Jun 24 02:41:32 2007] [432] Mounted handler at /test/non_wildcard +_handler [Sun Jun 24 02:41:32 2007] [432] Mounted wildcard handler at /test/wil +dcard_hand ler [Sun Jun 24 02:41:32 2007] [432] Mounted handler at /test/redirect [Sun Jun 24 02:41:32 2007] [432] Mounted handler at /test/relative_red +irect [Sun Jun 24 02:41:32 2007] [432] Mounted wildcard handler at /test/dat +a # Starting server [Sun Jun 24 02:41:32 2007] [-3992] Server started on http://desktop2:1 +9896/ ok 4 - Pathological case - mount doesn't exist (LWP request worked) ok 5 - Pathological case - mount doesn't exist (result code as expecte +d). ok 6 - Pathological case - mount doesn't exist (content matched). ok 7 - Directory indexing (LWP request worked) not ok 8 - Directory indexing (result code as expected). # Failed test 'Directory indexing (result code as expected).' # in t\serving.t at line 182. # got: 404 # expected: 200 not ok 9 - Directory indexing (content matched). # Failed test 'Directory indexing (content matched).' # in t\serving.t at line 183. # '<title>404 Not Found</title> # <h1>404 Not Found</h1> # File Not Found # ' # doesn't match '(?s-xim:static/test.*foo.html.*foo.txt)' ok 10 - Directory indexing (Mime type) ok 11 - Static file not found (LWP request worked) ok 12 - Static file not found (result code as expected). ok 13 - Static file not found (content matched). ok 14 - Plain text static file (LWP request worked) not ok 15 - Plain text static file (result code as expected). # Failed test 'Plain text static file (result code as expected).' # in t\serving.t at line 182. # got: 404 # expected: 200 not ok 16 - Plain text static file (content matched). # Failed test 'Plain text static file (content matched).' # in t\serving.t at line 183. # '<title>404 Not Found</title> # <h1>404 Not Found</h1> # File Not Found # ' # doesn't match '(?-xism:Hello Everybody)' not ok 17 - Plain text static file (Mime type) # Failed test 'Plain text static file (Mime type)' # in t\serving.t at line 185. # got: 'text/html' # expected: 'text/plain' ok 18 - HTML static file (LWP request worked) not ok 19 - HTML static file (result code as expected). # Failed test 'HTML static file (result code as expected).' # in t\serving.t at line 182. # got: 404 # expected: 200 not ok 20 - HTML static file (content matched). # Failed test 'HTML static file (content matched).' # in t\serving.t at line 183. # '<title>404 Not Found</title> # <h1>404 Not Found</h1> # File Not Found # ' # doesn't match '(?-xism:<html><body><h1>Hi Dr Nick</h1></body></h +tml>)' ok 21 - HTML static file (Mime type) ok 22 - HTTP Return code via handler return value (LWP request worked) ok 23 - HTTP Return code via handler return value (result code as expe +cted). ok 24 - HTTP Return code via handler return value (content matched). ok 25 - HTTP Return code via HTTP::Response->code() (LWP request worke +d) ok 26 - HTTP Return code via HTTP::Response->code() (result code as ex +pected). ok 27 - HTTP Return code via HTTP::Response->code() (content matched). ok 28 - More specific mount matched first (LWP request worked) ok 29 - More specific mount matched first (result code as expected). ok 30 - More specific mount matched first (content matched). ok 31 - Regular HTML mounted handler (LWP request worked) ok 32 - Regular HTML mounted handler (result code as expected). ok 33 - Regular HTML mounted handler (content matched). ok 34 - Regular HTML mounted handler (Mime type) ok 35 - Handlers default to non-wildcard (LWP request worked) ok 36 - Handlers default to non-wildcard (result code as expected). ok 37 - Handlers default to non-wildcard (content matched). ok 38 - Wildcard mounted handler root (LWP request worked) ok 39 - Wildcard mounted handler root (result code as expected). ok 40 - Wildcard mounted handler root (content matched). ok 41 - Wildcard mounted handler root (Mime type) ok 42 - Wildcard mounted handler with extra path (LWP request worked) ok 43 - Wildcard mounted handler with extra path (result code as expec +ted). ok 44 - Wildcard mounted handler with extra path (content matched). ok 45 - Wildcard mounted handler with extra path (Mime type) ok 46 - Fully qualified Redirect (LWP request worked) not ok 47 - Fully qualified Redirect (result code as expected). # Failed test 'Fully qualified Redirect (result code as expected).' # in t\serving.t at line 182. # got: 500 # expected: 200 not ok 48 - Fully qualified Redirect (content matched). # Failed test 'Fully qualified Redirect (content matched).' # in t\serving.t at line 183. # '500 Can't connect to desktop2:19896 (connect: Unk +nown error ) # ' # doesn't match '(?-xism:<html><body>No wildcards here</body></htm +l>)' not ok 49 - Fully qualified Redirect (Mime type) # Failed test 'Fully qualified Redirect (Mime type)' # in t\serving.t at line 185. # got: 'text/plain' # expected: 'text/html' ok 50 - Relative Redirect (LWP request worked) not ok 51 - Relative Redirect (result code as expected). # Failed test 'Relative Redirect (result code as expected).' # in t\serving.t at line 182. # got: 500 # expected: 200 not ok 52 - Relative Redirect (content matched). # Failed test 'Relative Redirect (content matched).' # in t\serving.t at line 183. # '500 Can't connect to desktop2:19896 (connect: Unk +nown error ) # ' # doesn't match '(?-xism:Path info: /flubber</p>)' not ok 53 - Relative Redirect (Mime type) # Failed test 'Relative Redirect (Mime type)' # in t\serving.t at line 185. # got: 'text/plain' # expected: 'text/html' ok 54 - HTTP::Response custom mime type (LWP request worked) ok 55 - HTTP::Response custom mime type (result code as expected). ok 56 - HTTP::Response custom mime type (content matched). ok 57 - HTTP::Response custom mime type (Mime type) [Sun Jun 24 02:41:35 2007] [432] [die] Your vendor has not defined POS +IX macro S IGHUP, used at t\serving.t line 191 Your vendor has not defined POSIX macro SIGHUP, used at t\serving.t li +ne 191 # Looks like you planned 59 tests but only ran 57. # Looks like you failed 13 tests of 57 run.
At which point it hangs.

(Sheesh ... is it really that late ? ... it is :-)

Btw, if you're not concerned about windows there are ways and means of ensuring that no Win32 cpan-tester will ever report a 'FAIL' for your module.

Cheers,
Rob

Replies are listed 'Best First'.
Re^4: Hoping for some beady eyes on my first CPAN submission
by garu (Scribe) on Jun 23, 2007 at 21:10 UTC
    Hmmm... Seems to be in fact a Windows x POSIX.pm issue. I tried to create a PoC using exactly the same code you had on t/serving.t on Windows to reproduce the problem:
    C:\>perl -e "use POSIX qw(:sys_wait_h SIGHUP SIGKILL); my $child_pid; if(!($child_pid = fork())) { exit(0); } kill(SIGKILL, $child_pid);" Your vendor has not defined POSIX macro SIGHUP, used at -e line 1
    Although only the "use" does not signal the problem, when you put it on kill(), it hangs. Same thing for SIGKILL...

    I'm using Windows XP and POSIX.pm version 1.09, just in case this is POSIX issue.
    C:\> perl -v This is perl, v5.8.8 built for MSWin32-x86-multi-thread (with 50 registered patches, see perl -V for more detail) Binary build 820 [274739] provided by ActiveState
      That's a pain - I only use forking for the test suite.

      Thanks for that awesome feedback - I'll have to have a think about how I do the testing for windows - I guess I can take a look at some of the other daemon modules and see if they test correctly on windows.

      Thanks a bunch!