From 68380d6952e113acf7bc122d629b9496d43a1a36 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Mon, 22 Jul 2024 13:02:29 +0200 Subject: [PATCH] be explicit about the signal to reset --- Tests/ApplicationTest.php | 10 ++++------ Tests/ConsoleEventsTest.php | 10 ++++------ Tests/SignalRegistry/SignalRegistryTest.php | 10 ++++------ 3 files changed, 12 insertions(+), 18 deletions(-) diff --git a/Tests/ApplicationTest.php b/Tests/ApplicationTest.php index d8e1ae8b9..ac1d47245 100644 --- a/Tests/ApplicationTest.php +++ b/Tests/ApplicationTest.php @@ -71,12 +71,10 @@ protected function tearDown(): void if (\function_exists('pcntl_signal')) { // We reset all signals to their default value to avoid side effects - for ($i = 1; $i <= 15; ++$i) { - if (9 === $i) { - continue; - } - pcntl_signal($i, \SIG_DFL); - } + pcntl_signal(\SIGINT, \SIG_DFL); + pcntl_signal(\SIGTERM, \SIG_DFL); + pcntl_signal(\SIGUSR1, \SIG_DFL); + pcntl_signal(\SIGUSR2, \SIG_DFL); } } diff --git a/Tests/ConsoleEventsTest.php b/Tests/ConsoleEventsTest.php index 93c228aa4..9c04d2706 100644 --- a/Tests/ConsoleEventsTest.php +++ b/Tests/ConsoleEventsTest.php @@ -35,12 +35,10 @@ protected function tearDown(): void if (\function_exists('pcntl_signal')) { pcntl_async_signals(false); // We reset all signals to their default value to avoid side effects - for ($i = 1; $i <= 15; ++$i) { - if (9 === $i) { - continue; - } - pcntl_signal($i, \SIG_DFL); - } + pcntl_signal(\SIGINT, \SIG_DFL); + pcntl_signal(\SIGTERM, \SIG_DFL); + pcntl_signal(\SIGUSR1, \SIG_DFL); + pcntl_signal(\SIGUSR2, \SIG_DFL); } } diff --git a/Tests/SignalRegistry/SignalRegistryTest.php b/Tests/SignalRegistry/SignalRegistryTest.php index 4cb435416..f997f7c1d 100644 --- a/Tests/SignalRegistry/SignalRegistryTest.php +++ b/Tests/SignalRegistry/SignalRegistryTest.php @@ -23,12 +23,10 @@ protected function tearDown(): void { pcntl_async_signals(false); // We reset all signals to their default value to avoid side effects - for ($i = 1; $i <= 15; ++$i) { - if (9 === $i) { - continue; - } - pcntl_signal($i, \SIG_DFL); - } + pcntl_signal(\SIGINT, \SIG_DFL); + pcntl_signal(\SIGTERM, \SIG_DFL); + pcntl_signal(\SIGUSR1, \SIG_DFL); + pcntl_signal(\SIGUSR2, \SIG_DFL); } public function testOneCallbackForASignalSignalIsHandled()