Skip Menu |

This queue is for tickets about the Parallel-SubFork CPAN distribution.

Report information
The Basics
Id: 33955
Status: resolved
Priority: 0/
Queue: Parallel-SubFork

People
Owner: Nobody in particular
Requestors: dagolden [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in:
  • 0.01
  • 0.02
  • 0.03
Fixed in: 0.04



Subject: Tests hang on Win32
Tests hang on Win32. If the module isn't Win32 compatible at all due to forking, please see Devel::CheckOS for a way to indicate that in Makefile.PL. Thanks, David Running make test C:\strawberry\perl\bin\perl.exe "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib\lib', 'blib\arch')" t/*.t t/00-distribution......skipped: Test::Distribution not installed t/00-pod-coverage......ok t/00-signature.........skipped: Set the environment variable TEST_SIGNATURE to e nable this test. t/01-exit.............. # Failed test 'Exit worked properly' # at t/01-exit.t line 30. # got: undef # expected: '42' # Failed test 'Exec worked properly' # at t/01-exit.t line 31. # got: undef # expected: '12' # Looks like you failed 2 tests of 4. Dubious, test returned 42 (wstat 10752, 0x2a00) Failed 2/4 subtests t/01-manager........... # Failed test 'Task exit code is fine' # at t/01-manager.t line 72. # got: undef # expected: '57' # Failed test 'Task status is fine' # at t/01-manager.t line 73. # got: undef # expected: '14592' # Failed test 'Second wait on the same task, exit code fine' # at t/01-manager.t line 83. # got: undef # expected: '57' # Failed test 'Second wait on the same task, status fine' # at t/01-manager.t line 84. # got: undef # expected: '14592' # Failed test 'No more processes' # at t/01-manager.t line 90. # got: '0' # expected: '-1' # Looks like you failed 5 tests of 17.
From: emmanuel.rodriguez [...] gmail.com
On Mon Mar 10 08:24:41 2008, DAGOLDEN wrote: Show quoted text
> Tests hang on Win32. If the module isn't Win32 compatible at all due to > forking, please see Devel::CheckOS for a way to indicate that in > Makefile.PL. > > Thanks, > David > > Running make test > C:\strawberry\perl\bin\perl.exe "-MExtUtils::Command::MM" "-e" > "test_harness(0, > 'blib\lib', 'blib\arch')" t/*.t > t/00-distribution......skipped: Test::Distribution not installed > t/00-pod-coverage......ok > t/00-signature.........skipped: Set the environment variable > TEST_SIGNATURE to e > nable this test. > t/01-exit.............. > # Failed test 'Exit worked properly' > # at t/01-exit.t line 30. > # got: undef > # expected: '42' > > # Failed test 'Exec worked properly' > # at t/01-exit.t line 31. > # got: undef > # expected: '12' > # Looks like you failed 2 tests of 4. > Dubious, test returned 42 (wstat 10752, 0x2a00) > Failed 2/4 subtests > t/01-manager........... > # Failed test 'Task exit code is fine' > # at t/01-manager.t line 72. > # got: undef > # expected: '57' > > # Failed test 'Task status is fine' > # at t/01-manager.t line 73. > # got: undef > # expected: '14592' > > # Failed test 'Second wait on the same task, exit code fine' > # at t/01-manager.t line 83. > # got: undef > # expected: '57' > > # Failed test 'Second wait on the same task, status fine' > # at t/01-manager.t line 84. > # got: undef > # expected: '14592' > > # Failed test 'No more processes' > # at t/01-manager.t line 90. > # got: '0' > # expected: '-1' > # Looks like you failed 5 tests of 17.
Can you tell me which version of Perl you used? An who's the provider (ActiveState, Cygwin)? I've realized that some of the tests have a race condition, although from the output you pasted this doesn't seem to be the case. I will try to take a look at the issue as fast as possible.
Subject: Re: [rt.cpan.org #33955] Tests hang on Win32
Date: Mon, 10 Mar 2008 14:47:34 -0400
To: bug-Parallel-SubFork [...] rt.cpan.org
From: "David Golden" <dagolden [...] cpan.org>
On Mon, Mar 10, 2008 at 2:09 PM, emmanuel.rodriguez@gmail.com via RT <bug-Parallel-SubFork@rt.cpan.org> wrote: Show quoted text
> Can you tell me which version of Perl you used? An who's the provider > (ActiveState, Cygwin)? > > I've realized that some of the tests have a race condition, although > from the output you pasted this doesn't seem to be the case. > > I will try to take a look at the issue as fast as possible.
I'm using Strawberry Perl 5.10 on Windows XP. I think the issue is that you're trying to signal with SIGHUP -- which isn't supported on Win32. (See the section about signals in perldoc perlwin32). If your child threads just sleep a couple seconds instead, the test don't hang anymore. (Though they do fail the tests). Ultimately, fork on Windows is dicey because of pseudo-forks. David
From: emmanuel.rodriguez [...] gmail.com
Show quoted text
> I'm using Strawberry Perl 5.10 on Windows XP. I think the issue is > that you're trying to signal with SIGHUP -- which isn't supported on > Win32. (See the section about signals in perldoc perlwin32). If your > child threads just sleep a couple seconds instead, the test don't hang > anymore. (Though they do fail the tests). > > Ultimately, fork on Windows is dicey because of pseudo-forks. > > David
At first my tests where written with a sleep, this made them longer to execute and less error prone with the race condition. Nevertheless, the race condition was still there. I will rewrite my tests to use a semaphore instead this will remove the race condition, also adding an alarm should help to ensure that the tests dont hang and that they fail in the case of another race condition. As for windows, this seems to be another issue, the logs you pasted me clearly show that the signal/fork stuff is not working right. I will take the proper measures in order to test or probe this particular case.
From: emmanuel.rodriguez [...] gmail.com
On Tue Mar 11 04:58:07 2008, POTYL wrote: Show quoted text
> > I'm using Strawberry Perl 5.10 on Windows XP. I think the issue is > > that you're trying to signal with SIGHUP -- which isn't supported on > > Win32. (See the section about signals in perldoc perlwin32). If your > > child threads just sleep a couple seconds instead, the test don't hang > > anymore. (Though they do fail the tests). > > > > Ultimately, fork on Windows is dicey because of pseudo-forks. > > > > David
> > At first my tests where written with a sleep, this made them longer to > execute and less error prone with the race condition. Nevertheless, the > race condition was still there. > > I will rewrite my tests to use a semaphore instead this will remove the > race condition, also adding an alarm should help to ensure that the > tests dont hang and that they fail in the case of another race condition. > > As for windows, this seems to be another issue, the logs you pasted me > clearly show that the signal/fork stuff is not working right. I will > take the proper measures in order to test or probe this particular case.
I create a new set of tests. They should be less prone to errors as alarm is used everywhere in order to ensure that the tests don't hang. I've replace the kill/pause system calls by semaphores (which aren't implemented under windows). I checked on IRC and fork seems really broken in windows. The best is to completely skip the tests that actually fork. The version 0.03 should fix the hang on Win32. Thanks for the bug report.