$num_children = 10;
}
-plan tests => $num_children + 5;
+plan tests => $num_children + 6;
use lib qw(t/lib);
{
local $SIG{__WARN__} = sub {};
eval { $dbh->do("DROP TABLE cd") };
- $dbh->do("CREATE TABLE cd (cdid serial PRIMARY KEY, artist INTEGER NOT NULL UNIQUE, title VARCHAR(255) NOT NULL UNIQUE, year VARCHAR(255));");
+ $dbh->do("CREATE TABLE cd (cdid serial PRIMARY KEY, artist INTEGER NOT NULL UNIQUE, title VARCHAR(100) NOT NULL UNIQUE, year VARCHAR(100) NOT NULL, genreid INTEGER, single_track INTEGER);");
}
$schema->resultset('CD')->create({ title => 'vacation in antarctica', artist => 123, year => 1901 });
};
ok(!$@) or diag "Creation eval failed: $@";
+{
+ my $pid = fork;
+ if(!defined $pid) {
+ die "fork failed: $!";
+ }
+
+ if (!$pid) {
+ exit $schema->storage->connected ? 1 : 0;
+ }
+
+ if (waitpid($pid, 0) == $pid) {
+ my $ex = $? >> 8;
+ ok($ex == 0, "storage->connected() returns false in child");
+ exit $ex if $ex; # skip remaining tests
+ }
+}
+
my @pids;
while(@pids < $num_children) {