Skip Menu |

This queue is for tickets about the Test CPAN distribution.

Report information
The Basics
Id: 36130
Status: open
Priority: 0/
Queue: Test

People
Owner: Nobody in particular
Requestors: Pascal [...] Rockford.Com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.25
Fixed in: (no value)



Subject: ok() does not increment correctly when forked
ok() does not increment correctly when forked causing Test::Harness v3+ to fail [root@mail2 t]# perl -MTest::Harness -e "runtests(test)" test.... All 3 subtests passed Test Summary Report ------------------- test (Wstat: 0 Tests: 3 Failed: 0) Parse errors: Tests out of sequence. Found (2) but expected (3) Files=1, Tests=3, 0 wallclock secs ( 0.03 usr 0.01 sys + 0.04 cusr 0.01 csys = 0.09 CPU) Result: FAIL Failed 1/1 test programs. 0/3 subtests failed. [root@mail2 t]# perl test 1..3 # Running under perl version 5.008008 for linux # Current time local: Fri May 23 04:51:47 2008 # Current time GMT: Fri May 23 09:51:47 2008 # Using Test.pm version 1.25 ok 1 ok 2 ok 2 [root@mail2 t]# cat test use Test; BEGIN { plan tests => 3 } ok(1); if (fork) { ok(1); } else { ok(1); } [root@mail2 t]#
From: JPRIT [...] cpan.org
This is not a bug. This is how fork works.
Not a bug.
Subject: Re: [rt.cpan.org #36130] ok() does not increment correctly when forked
Date: Thu, 12 Jun 2008 20:42:07 -0700
To: bug-Test [...] rt.cpan.org
From: Michael G Schwern <schwern [...] pobox.com>
Joshua_Pritikin via RT wrote: Show quoted text
> This is not a bug. This is how fork works.
Indeed, but it is an annoying testing situation. Perhaps you could suggest a work around? The original reporter might want to have a look at Test::Fork which tries to smooth testing with forks. -- emacs -- THAT'S NO EDITOR... IT'S AN OPERATING SYSTEM!