From 94d41825fd5b3b5e9437c6c589e20f91715b5a5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Sat, 6 Apr 2019 11:47:31 +0200 Subject: [PATCH] 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. --- .../Component/Lock/Tests/Store/BlockingStoreTestTrait.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/Lock/Tests/Store/BlockingStoreTestTrait.php b/src/Symfony/Component/Lock/Tests/Store/BlockingStoreTestTrait.php index 21f1245e7e..139fc25111 100644 --- a/src/Symfony/Component/Lock/Tests/Store/BlockingStoreTestTrait.php +++ b/src/Symfony/Component/Lock/Tests/Store/BlockingStoreTestTrait.php @@ -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); } }