Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
Hi,
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 https://rt.cpan.org/Public/Bug/Display.html?id=75005, 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 ?
Thanks,
updated title ,typo in name.

In reply to Net::Daemon make test failing on windows.. by prashantktyagi

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others about the Monastery: (11)
    As of 2014-10-24 10:42 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      For retirement, I am banking on:










      Results (131 votes), past polls