Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Plack CPAN distribution.

Report information
The Basics
Id: 67051
Status: open
Priority: 0/
Queue: Plack

People
Owner: Nobody in particular
Requestors: bo.johansson [...] lsn.se
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 0.99_75
Fixed in: (no value)



Subject: Tests are blocking in Windows 7
I am using: * Strawberry-perl-5.12.2.0 * Perl 5, version 12, subversion 2 (v5.12.2) built for MSWin32-x86-multi-thread * Windows 7 Home Premium with Service Pack 1 * Plack-0.9974 I tried ”cpan> test Plack” and got the output: ... Running make test C:\strawberry\perl\bin\perl.exe "-MExtUtils::Command::MM" "-e" "test_harness(0, 'inc', 'blib\lib', 'blib\arch')" t/*.t t/*/*.t t/00_compile.t ................................. ok t/HTTP-Message-PSGI/content_length.t ........... ok t/HTTP-Message-PSGI/path_info.t ................ ok t/HTTP-Message-PSGI/utf8_req.t ................. ok t/HTTP-Server-PSGI/post.t ...................... and after some time: cannot open port: 10608 at C:/strawberry/perl/site/lib/Test/TCP.pm line 83. Then the test is blocked and it is impossible to close the windows with CPAN. I do not understand why the port can not be opened, but the blocking of the test is typical using Windows 7. By the installation of Dancer and Padre I saw similar problems with test using Test-TCP and for all with the test of Test-TCP. The heavy use of fork and kill(9, $child) in Test-TCP seem to be a problem. See also: https://rt.cpan.org/Public/Bug/Display.html?id=66437 and https://rt.cpan.org/Public/Bug/Display.html?id=66016. My conclusion is that if you want to have portable Perl modules you have to consider all systems to use. In Windows the emulation of fork is a weak point. Kill must be avoided, in portable perl code, because kill(9, $child) is inherently unsafe for pseudo-processes used in Windows. See also https://rt.cpan.org/Public/Bug/Display.html?id=66437#txn-911256 . If you want to have an reliable and easy way to install things using Test-TCP like Planck, the tests of Test-TCP and the way Test-TCP is used must be changed. So, at least until the emulation of fork in Windows is more safe, this is important: To add an advice to explicitly shut down child processes by the implementation of modules intended to be portable. The purpose with this is to avoid the related problem in the emulation of fork in Windows. In the documentation of fork there could be a warning about the problem and an reference to perlfork http://perldoc.perl.org/perlfork.html. In perlfork there should be an advice to explicitly shut down child processes and how to avoid using kill(9, $child).
I know some people are working on upstream i.e. Test::TCP to fix this.
From: bo.johansson [...] lsn.se
Vid Tue, 29 Mar 2011 kl. 18.17.46, skrev MIYAGAWA: Show quoted text
> I know some people are working on upstream i.e. Test::TCP to fix this.
What I understand this can only partly be solved in Test-TCP. If you want to have an reliable and easy way to install things using Test-TCP like Planck, the tests of Test-TCP and the way Test-TCP is used must be changed. The tests of Plack must be written to explicitly shut down forked process without using kill. In portable Perl code kill must be avoided, because kill(9, $child) is inherently unsafe for pseudo-processes used in Windows. See also https://rt.cpan.org/Public/Bug/Display.html?id=66437#txn-911256 . My suggestion is to open this bug again!!
Subject: Re: [rt.cpan.org #67051] Tests are blocking in Windows 7
Date: Tue, 29 Mar 2011 23:36:06 -0700
To: bug-Plack [...] rt.cpan.org
From: Tatsuhiko Miyagawa <miyagawa [...] gmail.com>
On Tue, Mar 29, 2011 at 11:14 PM, Bo Johansson via RT <bug-Plack@rt.cpan.org> wrote: Show quoted text
> Vid Tue, 29 Mar 2011 kl. 18.17.46, skrev MIYAGAWA:
>> I know some people are working on upstream i.e. Test::TCP to fix this.
> > What I understand this can only partly be solved in Test-TCP. > > If you want to have an reliable and easy way to install things using > Test-TCP like Planck, the tests of Test-TCP and the way > Test-TCP is used must be changed. > > The tests of Plack must be written to explicitly shut down forked > process without using  kill.
There're absolutely no tests in Plack that use kill to shut down tests. Once the upstream Test-TCP is fixed then this is a non-issue.