X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fstorage%2Fglobal_destruction.t;h=4fb49cb68032df4f2d7de8511be6cdf9561d01cc;hb=c8dc7d3337cdd47a721739473b61c8d4477d9129;hp=8b22c8d5ce410f5a2bc787ac5f27db7f30f096db;hpb=9dfb034ff8191ec4648a65ac99dd5e281c7040c3;p=dbsrgits%2FDBIx-Class.git diff --git a/t/storage/global_destruction.t b/t/storage/global_destruction.t index 8b22c8d..4fb49cb 100644 --- a/t/storage/global_destruction.t +++ b/t/storage/global_destruction.t @@ -2,16 +2,12 @@ use strict; use warnings; use Test::More; -use Test::Exception; use DBIx::Class::Optional::Dependencies (); use lib qw(t/lib); use DBICTest; -plan skip_all => 'Test segfaults on Win32 - investigation pending' - if $^O eq 'MSWin32' && DBICTest::RunMode->is_plain; - for my $type (qw/PG MYSQL SQLite/) { SKIP: { @@ -44,29 +40,27 @@ for my $type (qw/PG MYSQL SQLite/) { ok (!$schema->storage->connected, "$type: start disconnected"); - lives_ok (sub { - $schema->txn_do (sub { - - ok ($schema->storage->connected, "$type: transaction starts connected"); + $schema->txn_do (sub { - my $pid = fork(); - SKIP: { - skip "Fork failed: $!", 1 if (! defined $pid); + ok ($schema->storage->connected, "$type: transaction starts connected"); - if ($pid) { - note "Parent $$ sleeping..."; - wait(); - note "Parent $$ woken up after child $pid exit"; - } - else { - note "Child $$ terminating"; - undef $DBICTest::FakeSchemaFactory::schema; - exit 0; - } + my $pid = fork(); + SKIP: { + skip "Fork failed: $!", 1 if (! defined $pid); - ok ($schema->storage->connected, "$type: parent still connected (in txn_do)"); + if ($pid) { + note "Parent $$ sleeping..."; + wait(); + note "Parent $$ woken up after child $pid exit"; + } + else { + note "Child $$ terminating"; + undef $DBICTest::FakeSchemaFactory::schema; + exit 0; } - }); + + ok ($schema->storage->connected, "$type: parent still connected (in txn_do)"); + } }); ok ($schema->storage->connected, "$type: parent still connected (outside of txn_do)");