Created
February 24, 2015 09:10
-
-
Save brgmn/a77f6ffadfd363e0ec5e to your computer and use it in GitHub Desktop.
Fake a low MySQL wait_timeout setting and force a exception
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function testCommand() { | |
$site = $this->siteRepository->findAll()->getFirst(); | |
/** @var Connection $connection */ | |
$connection = $this->entityManager->getConnection(); | |
$connection->exec('SET SESSION wait_timeout=1;'); | |
$this->outputLine('Set wait_timeout for mysql session to one second and wait two seconds now'); | |
sleep(2); | |
$domain = new Domain(); | |
$domain->setSite($site); | |
$domain->setHostPattern('katze2.de'); | |
$this->domainRepository->add($domain); | |
$this->persistenceManager->persistAll(); | |
$this->outputLine('Persistet.'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment