[Rt-commit] r15248 - rt/3.8/branches/parallel-testing/lib/RT
ruz at bestpractical.com
ruz at bestpractical.com
Tue Aug 19 17:29:18 EDT 2008
Author: ruz
Date: Tue Aug 19 17:29:18 2008
New Revision: 15248
Modified:
rt/3.8/branches/parallel-testing/lib/RT/Test.pm
Log:
* wait for children before dropping DB as those may have
connections to the DB
Modified: rt/3.8/branches/parallel-testing/lib/RT/Test.pm
==============================================================================
--- rt/3.8/branches/parallel-testing/lib/RT/Test.pm (original)
+++ rt/3.8/branches/parallel-testing/lib/RT/Test.pm Tue Aug 19 17:29:18 2008
@@ -236,6 +236,7 @@
DBIx::SearchBuilder::Record::Cachable->FlushCache;
}
+my @SERVERS;
sub started_ok {
require RT::Test::Web;
if ( $existing_server ) {
@@ -246,6 +247,7 @@
my $s = RT::Interface::Web::Standalone->new($port);
push @server, $s;
my $ret = $s->started_ok;
+ @SERVERS = $s->pids;
$RT::Handle = new RT::Handle;
$RT::Handle->dbh( undef );
RT->ConnectToDatabase;
@@ -792,6 +794,12 @@
my $Test = RT::Test->builder;
return if $Test->{Original_Pid} != $$;
if ( $ENV{RT_TEST_PARALLEL} && $created_new_db ) {
+ {
+ kill 'INT', @SERVERS;
+ foreach my $pid (@SERVERS) {
+ waitpid $pid, 0;
+ }
+ }
# Pg doesn't like if you issue a DROP DATABASE while still connected
my $dbh = $RT::Handle->dbh;
More information about the Rt-commit
mailing list