Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Why does Test-WWW-Mechanize-Catalyst-0.55\t\multi_content_type.t hang on win32?

by Anonymous Monk
on Oct 10, 2011 at 12:47 UTC ( #930617=perlquestion: print w/ replies, xml ) Need Help??
Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Why does Test-WWW-Mechanize-Catalyst-0.55\t\multi_content_type.t hang on win32?

Does it hangs for you?

Comment on Why does Test-WWW-Mechanize-Catalyst-0.55\t\multi_content_type.t hang on win32?
Re: Why does Test-WWW-Mechanize-Catalyst-0.55\t\multi_content_type.t hang on win32?
by keszler (Priest) on Oct 10, 2011 at 13:11 UTC

    Test-WWW-Mechanize-Catalyst-0.55\t\multi_content_type.t includes

    use_ok 'ExternalCatty'; my $pid = ExternalCatty->background($PORT);
    ExternalCatty does:
    sub background { my $self = shift; my $port = shift; my $child = fork; die "Can't fork Cat HTTP server: $!" unless defined $child; return $child if $child; if ( $^O !~ /MSWin32/ ) { require POSIX; POSIX::setsid() or die "Can't start a new session: $!"; } $self->run($port); }
    Maybe the fork is failing?

      Um, no, its hanging, if fork failed, program would end

      $ perl -Mblib t/multi_content_type.t 1..8 # # ################################################################### # Starting an external Catalyst HTTP server on port 7357 # To change the port, please set the TWMC_TEST_PORT env variable. # (The server will be automatically shut-down right after the tests). # ################################################################### ok 1 - use ExternalCatty;

        Without looking further into this - my experience with fork() and sockets on Windows has led me to always spawn external processes (that is, HTTP servers) for module self-testing instead. Launching an external process via pipe-open works for HTTP::Server::Simple, WWW::Mechanize, WWW::Mechanize::Firefox and WWW::Mechanize::Shell.

        I would not bother with investigating why fork and sockets don't interact like on Unix, because the fork-emulation never handled that well anyway.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://930617]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2014-12-21 01:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (100 votes), past polls