Skip Menu |

This queue is for tickets about the DBI CPAN distribution.

Report information
The Basics
Id: 29378
Status: resolved
Priority: 0/
Queue: DBI

People
Owner: Nobody in particular
Requestors: jdhedden [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in:
  • 1.59
  • 1.59_3
Fixed in: (no value)



Subject: Test::More 0.71 causes test failures
Test::More 0.71 causes test failures: t/zvg_05thrclone..........You tried to run a test without a plan at ./t/05thrclone.t line 37. BEGIN failed--compilation aborted at ./t/05thrclone.t line 38. Compilation failed in require at t/zvg_05thrclone.t line 4. # Looks like your test died before it could output anything. dubious Test returned status 255 (wstat 65280, 0xff00) The attached patch fixes this.
Subject: dbi.patch
diff -urN DBI-1.59/t/05thrclone.t DBI-patched/t/05thrclone.t --- DBI-1.59/t/05thrclone.t 2007-08-22 12:45:36.000000000 -0400 +++ DBI-patched/t/05thrclone.t 2007-09-14 22:28:44.675250000 -0400 @@ -10,16 +10,18 @@ use Config qw(%Config); use Test::More; +my $threads; + BEGIN { if (!$Config{useithreads} || $] < 5.008) { plan skip_all => "this $^O perl $] not configured to support iThreads"; } die $use_threads_err if $use_threads_err; # need threads -} -my $threads = 10; + $threads = 10; -plan tests => 3 + 4 * $threads; + plan tests => 3 + 4 * $threads; +} # Something about DBD::Gofer causes a problem. Older versions didn't leak. It # started at some point in development but I didn't track it down at the time
CC: mschwern [...] cpan.org
Subject: Re: [rt.cpan.org #29378] Test::More 0.71 causes test failures
Date: Sat, 15 Sep 2007 10:01:21 +0100
To: "Jerry D. Hedden via RT" <bug-DBI [...] rt.cpan.org>
From: Tim Bunce <Tim.Bunce [...] pobox.com>
On Fri, Sep 14, 2007 at 10:35:18PM -0400, Jerry D. Hedden via RT wrote: Show quoted text
> > Fri Sep 14 22:35:15 2007: Request 29378 was acted upon. > Transaction: Ticket created by JDHEDDEN > Queue: DBI > Subject: Test::More 0.71 causes test failures > Broken in: 1.59, 1.59_3 > Severity: Important > Owner: Nobody > Requestors: JDHEDDEN@cpan.org > Status: new > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=29378 > > > > Test::More 0.71 causes test failures: > > t/zvg_05thrclone..........You tried to run a test without a plan at > ./t/05thrclone.t line 37. > BEGIN failed--compilation aborted at ./t/05thrclone.t line 38. > Compilation failed in require at t/zvg_05thrclone.t line 4. > # Looks like your test died before it could output anything. > dubious > Test returned status 255 (wstat 65280, 0xff00) > > The attached patch fixes this.
What's the underlying cause here? It looks to me like a bug in Test::More. Tim. Show quoted text
> > diff -urN DBI-1.59/t/05thrclone.t DBI-patched/t/05thrclone.t > --- DBI-1.59/t/05thrclone.t 2007-08-22 12:45:36.000000000 -0400 > +++ DBI-patched/t/05thrclone.t 2007-09-14 22:28:44.675250000 -0400 > @@ -10,16 +10,18 @@ > use Config qw(%Config); > use Test::More; > > +my $threads; > + > BEGIN { > if (!$Config{useithreads} || $] < 5.008) { > plan skip_all => "this $^O perl $] not configured to support iThreads"; > } > die $use_threads_err if $use_threads_err; # need threads > -} > > -my $threads = 10; > + $threads = 10; > > -plan tests => 3 + 4 * $threads; > + plan tests => 3 + 4 * $threads; > +} > > # Something about DBD::Gofer causes a problem. Older versions didn't leak. It > # started at some point in development but I didn't track it down at the time >
CC: "Jerry D. Hedden via RT" <bug-DBI [...] rt.cpan.org>, mschwern [...] cpan.org
Subject: Re: [rt.cpan.org #29378] Test::More 0.71 causes test failures
Date: Sat, 15 Sep 2007 02:19:43 -0700
To: Tim Bunce <Tim.Bunce [...] pobox.com>
From: Michael G Schwern <schwern [...] pobox.com>
Tim Bunce wrote: Show quoted text
>> t/zvg_05thrclone..........You tried to run a test without a plan at >> ./t/05thrclone.t line 37. >> BEGIN failed--compilation aborted at ./t/05thrclone.t line 38. >> Compilation failed in require at t/zvg_05thrclone.t line 4. >> # Looks like your test died before it could output anything. >> dubious >> Test returned status 255 (wstat 65280, 0xff00) >> >> The attached patch fixes this.
> > What's the underlying cause here? > > It looks to me like a bug in Test::More.
The opposite. There *was* a bug in Test::More that was masking a mistake in your test. Now its fixed and the problem is revealed. The message is correct, you are trying to run a test without a plan. That test is the use_ok() inside a BEGIN block on line 36 of t/05thrclone.t. You're running a test at BEGIN time but planning (at line 22) at run time. Previously this mistake was silently ignored. In this case it's simpler to not put use_ok() inside a BEGIN block. --- t/05thrclone.t 2007/09/15 09:15:01 1.1 +++ t/05thrclone.t 2007/09/15 09:17:27 @@ -18,8 +18,7 @@ } my $threads = 10; - -plan tests => 3 + 4 * $threads; +plan tests => 4 + 4 * $threads; # Something about DBD::Gofer causes a problem. Older versions didn't leak. It # started at some point in development but I didn't track it down at the time @@ -33,9 +32,7 @@ use base qw(threads); } -BEGIN { - use_ok('DBI'); -} +use_ok('DBI'); $DBI::neat_maxlen = 12345; cmp_ok($DBI::neat_maxlen, '==', 12345, '... assignment of neat_maxlen was successful'); -- Ahh email, my old friend. Do you know that revenge is a dish that is best served cold? And it is very cold on the Internet!
CC: Tim Bunce <Tim.Bunce [...] pobox.com>, "Jerry D. Hedden via RT" <bug-DBI [...] rt.cpan.org>, mschwern [...] cpan.org
Subject: Re: [rt.cpan.org #29378] Test::More 0.71 causes test failures
Date: Sat, 15 Sep 2007 19:13:30 +0100
To: Michael G Schwern <schwern [...] pobox.com>
From: Tim Bunce <Tim.Bunce [...] pobox.com>
On Sat, Sep 15, 2007 at 02:19:43AM -0700, Michael G Schwern wrote: Show quoted text
> Tim Bunce wrote:
> >> t/zvg_05thrclone..........You tried to run a test without a plan at > >> ./t/05thrclone.t line 37. > >> BEGIN failed--compilation aborted at ./t/05thrclone.t line 38. > >> Compilation failed in require at t/zvg_05thrclone.t line 4. > >> # Looks like your test died before it could output anything. > >> dubious > >> Test returned status 255 (wstat 65280, 0xff00) > >> > >> The attached patch fixes this.
> > > > What's the underlying cause here? > > > > It looks to me like a bug in Test::More.
> > The opposite. There *was* a bug in Test::More that was masking a mistake in > your test. Now its fixed and the problem is revealed. > > The message is correct, you are trying to run a test without a plan. That > test is the use_ok() inside a BEGIN block on line 36 of t/05thrclone.t.
Ah. That makes sense. Thanks. Tim. Show quoted text
> You're running a test at BEGIN time but planning (at line 22) at run time. > Previously this mistake was silently ignored. > > In this case it's simpler to not put use_ok() inside a BEGIN block. > > --- t/05thrclone.t 2007/09/15 09:15:01 1.1 > +++ t/05thrclone.t 2007/09/15 09:17:27 > @@ -18,8 +18,7 @@ > } > > my $threads = 10; > - > -plan tests => 3 + 4 * $threads; > +plan tests => 4 + 4 * $threads; > > # Something about DBD::Gofer causes a problem. Older versions didn't leak. It > # started at some point in development but I didn't track it down at the time > @@ -33,9 +32,7 @@ > use base qw(threads); > } > > -BEGIN { > - use_ok('DBI'); > -} > +use_ok('DBI'); > > $DBI::neat_maxlen = 12345; > cmp_ok($DBI::neat_maxlen, '==', 12345, '... assignment of neat_maxlen was > successful'); > > > > -- > Ahh email, my old friend. Do you know that revenge is a dish that is best > served cold? And it is very cold on the Internet!
Fixed. Thanks.