New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
threads and subtests #145
Comments
@tokuhirom #147 was a duplicate. |
Yep, it's a bug. Looks like something in the subtest code didn't get declared shared. Feel free to dig in. |
I can cut this down to pretty much any subtest with threads on. The issue is the way subtest copies the Builder object, it loses the shared-ness of it's keys. |
schwern
added a commit
that referenced
this issue
Oct 18, 2011
child() was improperly creating it's own object and calling reset() manually and then copying filehandles from the parent directly rather than going through the accessors. Now it uses create() and the accessors. Related... fix Test::Builder::NoOutput->create so it doesn't use global filehandles and blow over them every time create() is called (as by a child). The reset_outputs() in the basic subtest test were a symptom of this confusion and are no longer needed. For #145
schwern
added a commit
that referenced
this issue
Oct 18, 2011
The shared nature of a scalar value, in this case $self->{Curr_Test} is lost across a simple hash copy as subtest() was doing. So we reshare them on copy. For #145 Signed-off-by: Michael G. Schwern <schwern@pobox.com>
That should do it. It'll be in the next release coming soon. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
sample code:
If run as is, output is:
If you comment out the 'subtest' line and the corresponding '};' line, you get:
As the documentation specifies, 'use threads' is before 'use Test::More', but if a subtest is involved, tests do not run as expected
The text was updated successfully, but these errors were encountered: