Page MenuHomestyx hydra

No OneTemporary

diff --git a/src/infrastructure/testing/fixture/PhabricatorStorageFixtureScopeGuard.php b/src/infrastructure/testing/fixture/PhabricatorStorageFixtureScopeGuard.php
index 50a7f9d105..2624427dc8 100644
--- a/src/infrastructure/testing/fixture/PhabricatorStorageFixtureScopeGuard.php
+++ b/src/infrastructure/testing/fixture/PhabricatorStorageFixtureScopeGuard.php
@@ -1,38 +1,43 @@
<?php
/**
* Used by unit tests to build storage fixtures.
*/
final class PhabricatorStorageFixtureScopeGuard extends Phobject {
private $name;
public function __construct($name) {
$this->name = $name;
execx(
'php %s upgrade --force --no-adjust --namespace %s',
$this->getStorageBinPath(),
$this->name);
PhabricatorLiskDAO::pushStorageNamespace($name);
// Destructor is not called with fatal error.
register_shutdown_function(array($this, 'destroy'));
}
public function destroy() {
PhabricatorLiskDAO::popStorageNamespace();
+ // NOTE: We need to close all connections before destroying the databases.
+ // If we do not, the "DROP DATABASE ..." statements may hang, waiting for
+ // our connections to close.
+ PhabricatorLiskDAO::closeAllConnections();
+
execx(
'php %s destroy --force --namespace %s',
$this->getStorageBinPath(),
$this->name);
}
private function getStorageBinPath() {
$root = dirname(phutil_get_library_root('phabricator'));
return $root.'/scripts/sql/manage_storage.php';
}
}

File Metadata

Mime Type
text/x-diff
Expires
Thu, Aug 14, 9:54 PM (3 d, 6 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
195843
Default Alt Text
(1 KB)

Event Timeline