Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Test-Simple CPAN distribution.

Report information
The Basics
Id: 19310
Status: resolved
Priority: 0/
Queue: Test-Simple

People
Owner: Nobody in particular
Requestors: rybskej [...] yahoo.com
Cc:
AdminCc:

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



Subject: Test::Builder END block issue when with threads and forks
Date: Wed, 17 May 2006 10:08:06 -0700
To: bug-test-simple [...] rt.cpan.org
From: "Michael G Schwern" <schwern [...] gmail.com>
Show quoted text
--------- Forwarded message ---------- From: Eric Rybski <rybskej@yahoo.com> Date: May 16, 2006 2:21 PM Subject: Test::Builder END block issue when with threads and forks To: schwern@pobox.com Michael, In Test::Builder 0.32, subroutine _ending, the $self->_sanity_check(); should come after the determination if this is a forked copy, as it causes problems with test scripts that mix threads and forks. Warnings get randomly thrown otherwise, due to the fact that the shared variables within _sanity_check() may be modified by another thread while in this end block (a potential race condition), causing the 'Somehow you got a different number of results than tests ran!' error to be thrown at random times while running a test script that uses Test::Builder. The diff is at the end of this message. Hopefully this will make it into a future release of your module! Thanks, Eric Rybski --- /usr/local/lib/perl5/5.8.7/Test/Builder.pm 2006-04-29 19:41: 18.419994000 -0400 +++ /usr/local/lib/perl5/5.8.7/Test/Builder.pm.threadfork_patch 2006-05-16 17:13:43.550005000 -0400 @@ -1589,8 +1589,6 @@ sub _ending { my $self = shift; - $self->_sanity_check(); - # Don't bother with an ending if this is a forked copy. Only the parent # should do the ending. # Exit if plan() was never called. This is so "require Test::Simple" @@ -1605,6 +1603,8 @@ return; } + $self->_sanity_check(); +
The patch looks reasonable; if you could submit a failing test case as well that the patch fixes, I'll apply them both.
On Fri Jun 20 11:41:35 2008, HDP wrote: Show quoted text
> The patch looks reasonable; if you could submit a failing test case as > well that the patch fixes, I'll apply them both.
There is no failing test here to check if this is still a problem. Test2 overhauled the fork/thread support, so the problem may be gone. Please re-open on github if this is still an issue.