X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F51threads.t;h=fb7cf104898fc347fcaa10e6167a63ab21f295ec;hb=a870aa85e;hp=3a26de98ab94163d5f4756490edc37fc003c59b7;hpb=8ec03a3a564eb64e781e343f93f6948f043f8eb1;p=dbsrgits%2FDBIx-Class.git diff --git a/t/51threads.t b/t/51threads.t index 3a26de9..fb7cf10 100644 --- a/t/51threads.t +++ b/t/51threads.t @@ -9,6 +9,11 @@ BEGIN { if !$Config{useithreads}; } +BEGIN { + plan skip_all => 'Minimum of perl 5.8.5 required for thread tests (DBD::Pg mandated)' + if $] < '5.008005'; +} + use threads; use Test::Exception; use lib qw(t/lib); @@ -19,18 +24,13 @@ plan skip_all => 'Set $ENV{DBICTEST_PG_DSN}, _USER and _PASS to run this test' # README: If you set the env var to a number greater than 10, # we will use that many children -my $num_children = $ENV{DBICTEST_THREAD_STRESS}; - -plan skip_all => 'Set $ENV{DBICTEST_THREAD_STRESS} to run this test' - unless $num_children; - +my $num_children = $ENV{DBICTEST_THREAD_STRESS} || 1; if($num_children !~ /^[0-9]+$/ || $num_children < 10) { $num_children = 10; } -diag 'It is normal to see a series of "Scalars leaked: ..." warnings during this test'; - use_ok('DBICTest::Schema'); + my $schema = DBICTest::Schema->connection($dsn, $user, $pass, { AutoCommit => 1, RaiseError => 1, PrintError => 0 }); my $parent_rs;