mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-08-25 20:15:44 +02:00
Merge pull request #7170 from robbieaverill/pulls/4.0/ignore-exceptions-on-killing-testdb
FIX Ignore exceptions thrown when deleting test databases
This commit is contained in:
commit
be0e16d648
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace SilverStripe\ORM\Connect;
|
namespace SilverStripe\ORM\Connect;
|
||||||
|
|
||||||
|
use Exception;
|
||||||
use SilverStripe\Core\ClassInfo;
|
use SilverStripe\Core\ClassInfo;
|
||||||
use SilverStripe\Core\Injector\Injectable;
|
use SilverStripe\Core\Injector\Injectable;
|
||||||
use SilverStripe\Core\Injector\Injector;
|
use SilverStripe\Core\Injector\Injector;
|
||||||
@ -92,7 +93,6 @@ class TempDatabase
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// echo "Deleted temp database " . $dbConn->currentDatabase() . "\n";
|
|
||||||
$dbConn->dropSelectedDatabase();
|
$dbConn->dropSelectedDatabase();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -147,7 +147,11 @@ class TempDatabase
|
|||||||
|
|
||||||
// Ensure test db is killed on exit
|
// Ensure test db is killed on exit
|
||||||
register_shutdown_function(function () {
|
register_shutdown_function(function () {
|
||||||
|
try {
|
||||||
$this->kill();
|
$this->kill();
|
||||||
|
} catch (Exception $ex) {
|
||||||
|
// An exception thrown while trying to remove a test database shouldn't fail a build, ignore
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return $dbname;
|
return $dbname;
|
||||||
|
Loading…
Reference in New Issue
Block a user