Skip to content

Commit 192809d

Browse files
roslovDavertMik
authored andcommitted
Yii2: Fix Too many connections issue (#5175)
1 parent 82f7254 commit 192809d

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/Codeception/Module/Yii2.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -344,12 +344,6 @@ public function _after(TestInterface $test)
344344

345345
$this->rollbackTransactions();
346346

347-
if (isset($this->connectionWatcher)) {
348-
$this->connectionWatcher->stop();
349-
$this->connectionWatcher->closeAll();
350-
unset($this->connectionWatcher);
351-
}
352-
353347
if ($this->config['cleanup']) {
354348
foreach ($this->loadedFixtures as $fixture) {
355349
$fixture->unloadFixtures();
@@ -358,6 +352,13 @@ public function _after(TestInterface $test)
358352
}
359353

360354
$this->client->resetApplication();
355+
356+
if (isset($this->connectionWatcher)) {
357+
$this->connectionWatcher->stop();
358+
$this->connectionWatcher->closeAll();
359+
unset($this->connectionWatcher);
360+
}
361+
361362
parent::_after($test);
362363
}
363364

0 commit comments

Comments
 (0)