Ensure the parent process is always killed
If you try to run the test suite but do not have a redis instance running, the parent process that was supposed to be killed will never be as the thing being thrown is not an exception. This results in the test suite hanging forever at the end. In this patch, the exception is thrown again, and then caught in the trait, and the parent gets killed as it should.
This commit is contained in:
parent
25db9e26c9
commit
94d41825fd
@ -74,8 +74,8 @@ trait BlockingStoreTestTrait
|
||||
// Block SIGHUP signal
|
||||
pcntl_sigprocmask(SIG_BLOCK, [SIGHUP]);
|
||||
|
||||
$store = $this->getStore();
|
||||
try {
|
||||
$store = $this->getStore();
|
||||
$store->save($key);
|
||||
// send the ready signal to the parent
|
||||
posix_kill($parentPID, SIGHUP);
|
||||
@ -87,7 +87,8 @@ trait BlockingStoreTestTrait
|
||||
usleep($clockDelay);
|
||||
$store->delete($key);
|
||||
exit(0);
|
||||
} catch (\Exception $e) {
|
||||
} catch (\Throwable $e) {
|
||||
posix_kill($parentPID, SIGHUP);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user