prashantktyagi has asked for the wisdom of the Perl Monks concerning the following question:

I am installing Net::Daemon (v0.48) from source. I am on activestate Perl v 5.16.3 (Win 7 64 bit). make test return failure and cause perl interpreter to stop working in t/threadm.t test. I debugged test and found this.
c:\Perl64\cpan\build\Net-Daemon-0.48-ISrOkZ>perl "-MExtUtils::Command: +:MM" "-e" "test_harness(1, 'blib\lib', 'blib\arch')" t/ithreadm.t t/ithreadm.t .. Starting server: C:\Perl64\bin\perl.exe -Iblib/lib -Iblib/arch t/serve +r --mode=ithreads logfile=stderr debug Starting process: proc = C:\Perl64\bin\perl.exe, args = C:\Perl64\bin\ +perl.exe -Iblib/lib -Iblib/arch t/server --mode=ithreads logfile=stde +r r debug 1..10 ok 1 Dubious, test returned 116 (wstat 29696, 0x7400) Failed 9/10 subtests Test Summary Report ------------------- t/ithreadm.t (Wstat: 29696 Tests: 1 Failed: 0) Non-zero exit status: 116 Parse errors: Bad plan. You planned 10 tests but ran 1. Files=1, Tests=1, 5 wallclock secs ( 0.06 usr + 0.00 sys = 0.06 CPU +) Result: FAIL Failed 1/1 test programs. 0/1 subtests failed.
I have checked the test code and it is failing on $tid->join(). That time I can see mutiple instance of perl process in the system.
my @threads; for (my $i = 0; $i < 10; $i++) { #print "Spawning child $i.\n"; my $tid = threads->new(\&MyChild, $i); if (!$tid) { print STDERR "Failed to create new thread: $!\n"; exit 1; } push(@threads, $tid); } eval { alarm 1; alarm 0 }; alarm 120 unless $@; for (my $i = 1; $i <= 10; $i++) { my $tid = shift @threads; #culprit==== if ($tid->join()) { print "ok $i\n"; } else { print "not ok $i\n"; } }
I have checked cpan-rt and found similiar bug, but the workaround didn't solve my problem. When I modify condition
if (1) { print "ok $i\n"; } else {
test went pass. I am not much familiar with threads, so why this is causing the problem. Is this a test problem? should I report a bug on cpan RT ?
updated title ,typo in name.

Replies are listed 'Best First'.
Re: Net::Daemon make test failing on windows..
by Anonymous Monk on Apr 26, 2013 at 12:53 UTC

    When I modify condition

    Don't do that, its a waste of time

    You can install a module with failing test, you either skip the tests, or you force install, or both cpan -f -i -T Net::Daemon

    You get to decide if this bug affects you -- if you're a programmer and experience problems with your app after the update, don't forget about these failing tests, don't forget to check the changelog/changes

    should I report a bug on cpan RT ?

    Given that there are many FAIL reports (97) and many open RT tickets, chances are its a known issue

    This patch looks interesting Bug #82539 for Net-Daemon: Net::Daemon fork mode on Windows/Strawberry Perl