10000 Ensure the parent process is always killed · sroze/symfony@94d4182 · GitHub
[go: up one dir, main page]

Skip to content

Commit 94d4182

Browse files
committed
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.
1 parent 25db9e2 commit 94d4182

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Symfony/Component/Lock/Tests/Store/BlockingStoreTestTrait.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ public function testBlockingLocks()
7474
// Block SIGHUP signal
7575
pcntl_sigprocmask(SIG_BLOCK, [SIGHUP]);
7676

77-
$store = $this->getStore();
7877
try {
78+
$store = $this->getStore();
7979
$store->save($key);
8080
// send the ready signal to the parent
8181
posix_kill($parentPID, SIGHUP);
@@ -87,7 +87,8 @@ public function testBlockingLocks()
8787
usleep($clockDelay);
8888
$store->delete($key);
8989
exit(0);
90-
} catch (\Exception $e) {
90+
} catch (\Throwable $e) {
91+
posix_kill($parentPID, SIGHUP);
9192
exit(1);
9293
}
9394
}

0 commit comments

Comments
 (0)
0