10 for my $type (qw/PG MYSQL/) {
13 skip "Skipping $type tests without DBICTEST_${type}_DSN", 1
14 unless $ENV{"DBICTEST_${type}_DSN"};
16 my $schema = DBICTest::Schema->connect (@ENV{map { "DBICTEST_${type}_${_}" } qw/DSN USER PASS/});
18 # emulate a singleton-factory, just cache the object *somewhere in a different package*
19 # to induce out-of-order destruction
20 $DBICTest::FakeSchemaFactory::schema = $schema;
22 # so we can see the retry exceptions (if any)
23 $ENV{DBIC_DBIRETRY_DEBUG} = 1;
25 ok (!$schema->storage->connected, "$type: start disconnected");
28 $schema->txn_do (sub {
30 ok ($schema->storage->connected, "$type: transaction starts connected");
34 skip "Fork failed: $!", 1 if (! defined $pid);
37 note "Parent $$ sleeping...";
39 note "Parent $$ woken up after child $pid exit";
42 note "Child $$ terminating";
46 ok ($schema->storage->connected, "$type: parent still connected (in txn_do)");
51 ok ($schema->storage->connected, "$type: parent still connected (outside of txn_do)");
53 undef $DBICTest::FakeSchemaFactory::schema;