Skip to content

Commit

Permalink
Explicitly disconnect from database.
Browse files Browse the repository at this point in the history
The garbage collection of destructed objects doesn't seem to kick-in fast
enough to free enough database connection resources for running many tests in a
row. At least on my fresh PHP 5.5 installation.
  • Loading branch information
yunosh committed Oct 24, 2013
1 parent b0f8517 commit fe37ed0
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 0 deletions.
Expand Up @@ -194,6 +194,7 @@ public static function tearDownAfterClass()
if (self::$migrator) {
self::$migrator->down();
}
self::$db->disconnect();
self::$db = null;
parent::tearDownAfterClass();
}
Expand Down
1 change: 1 addition & 0 deletions framework/Auth/test/Horde/Auth/Unit/Sql/Base.php
Expand Up @@ -47,6 +47,7 @@ public static function tearDownAfterClass()
if (self::$migrator) {
self::$migrator->down();
}
self::$db->disconnect();
self::$db = null;
parent::tearDownAfterClass();
}
Expand Down
1 change: 1 addition & 0 deletions framework/Group/test/Horde/Group/Sql/Base.php
Expand Up @@ -152,6 +152,7 @@ public static function tearDownAfterClass()
if (self::$migrator) {
self::$migrator->down();
}
self::$db->disconnect();
self::$db = null;
parent::tearDownAfterClass();
}
Expand Down
1 change: 1 addition & 0 deletions framework/Prefs/test/Horde/Prefs/Unit/Storage/Sql/Base.php
Expand Up @@ -85,6 +85,7 @@ public static function tearDownAfterClass()
if (self::$migrator) {
self::$migrator->down();
}
self::$db->disconnect();
self::$db = null;
}

Expand Down
1 change: 1 addition & 0 deletions framework/Rdo/test/Horde/Rdo/Sql/Base.php
Expand Up @@ -288,6 +288,7 @@ public static function tearDownAfterClass()
$migration->dropTable('test_manytomanya');
$migration->dropTable('test_manytomanyb');
$migration->dropTable('test_manythrough');
self::$db->disconnect();
self::$db = null;
}
}
Expand Down
Expand Up @@ -95,6 +95,7 @@ public static function tearDownAfterClass()
if (self::$migrator) {
self::$migrator->down();
}
self::$db->disconnect();
self::$db = null;
parent::tearDownAfterClass();
}
Expand Down
1 change: 1 addition & 0 deletions framework/Share/test/Horde/Share/Sql/Base.php
Expand Up @@ -205,6 +205,7 @@ public static function tearDownAfterClass()
$migration->dropTable('test_shares');
$migration->dropTable('test_shares_groups');
$migration->dropTable('test_shares_users');
self::$db->disconnect();
self::$db = null;
}
}
Expand Down
1 change: 1 addition & 0 deletions framework/Share/test/Horde/Share/Sqlng/Base.php
Expand Up @@ -206,6 +206,7 @@ public static function tearDownAfterClass()
$migration->dropTable('test_shares');
$migration->dropTable('test_shares_groups');
$migration->dropTable('test_shares_users');
self::$db->disconnect();
self::$db = null;
}
}
Expand Down
1 change: 1 addition & 0 deletions framework/Vfs/test/Horde/Vfs/Sql/Base.php
Expand Up @@ -186,6 +186,7 @@ public static function tearDownAfterClass()
if (self::$migrator) {
self::$migrator->down();
}
self::$db->disconnect();
self::$db = null;
parent::tearDownAfterClass();
}
Expand Down
1 change: 1 addition & 0 deletions framework/Vfs/test/Horde/Vfs/SqlFile/Base.php
Expand Up @@ -190,6 +190,7 @@ public static function tearDownAfterClass()
if (self::$migrator) {
self::$migrator->down();
}
self::$db->disconnect();
self::$db = null;
parent::tearDownAfterClass();
}
Expand Down

0 comments on commit fe37ed0

Please sign in to comment.