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: 96916
Status: resolved
Priority: 0/
Queue: Test-Simple

People
Owner: Nobody in particular
Requestors: ribasushi [...] leporine.io
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 1.301001_001
Fixed in: (no value)



Subject: 1.3 does not behave identically under threads
This example test passes on all stable versions of Test::More, but fails on the 1.3 trial. The code as seen does not use any non-oficial APIs and was originally suggested by Schwern himself during the 2012 QA hackathon. rabbit@Ahasver:~/devel/dbic$ prove -l thearfail.txt -v thearfail.txt .. ok 1 - Test starts ok 1 - In-thread ok ok 2 - In-thread ok ok 3 - In-thread ok 1..4 ok 2 - Made it to the end 1..6 Failed 4/6 subtests Test Summary Report ------------------- thearfail.txt (Wstat: 0 Tests: 2 Failed: 0) Parse errors: Bad plan. You planned 6 tests but ran 2.
Subject: thearfail.txt
use Config; BEGIN { unless ($Config{useithreads}) { print "1..0 # SKIP your perl does not support ithreads\n"; exit 0; } if ($INC{'Devel/Cover.pm'}) { print "1..0 # SKIP Devel::Cover does not work with threads yet\n"; exit 0; } } use threads; use strict; use warnings; use Test::More; # basic tests { pass('Test starts'); my $ct_num = Test::More->builder->current_test; my $newthread = async { my $out = ''; #simulate a subtest to not confuse the parent TAP emission my $tb = Test::More->builder; $tb->reset; Test::More->builder->current_test(0); for (qw/output failure_output todo_output/) { close $tb->$_; open ($tb->$_, '>', \$out); } pass("In-thread ok") for (1,2,3); done_testing; close $tb->$_ for (qw/output failure_output todo_output/); sleep(1); # tasty crashes without this $out; }; die "Thread creation failed: $! $@" if !defined $newthread; my $out = $newthread->join; $out =~ s/^/ /gm; print $out; # workaround for older Test::More confusing the plan under threads Test::More->builder->current_test($ct_num); pass("Made it to the end"); } done_testing;
I think that this Problem has been solved by the latest version. Please try 'Test-Simple-1.301001_003' $ /usr/bin/perl -Ilib thread.t ok 1 - Test starts ok 1 - In-thread ok ok 2 - In-thread ok ok 3 - In-thread ok 1..4 ok 2 - Made it to the end 1..6 On 2014-7月-03 木 10:23:10, RIBASUSHI wrote: Show quoted text
> This example test passes on all stable versions of Test::More, but > fails on the 1.3 trial. The code as seen does not use any non-oficial > APIs and was originally suggested by Schwern himself during the 2012 > QA hackathon. > > rabbit@Ahasver:~/devel/dbic$ prove -l thearfail.txt -v > thearfail.txt .. > ok 1 - Test starts > ok 1 - In-thread ok > ok 2 - In-thread ok > ok 3 - In-thread ok > 1..4 > ok 2 - Made it to the end > 1..6 > Failed 4/6 subtests > > Test Summary Report > ------------------- > thearfail.txt (Wstat: 0 Tests: 2 Failed: 0) > Parse errors: Bad plan. You planned 6 tests but ran 2.
This is still broken even in _005. I will fix it.