Skip to content

Commit

Permalink
be explicit about the signal to reset
Browse files Browse the repository at this point in the history
  • Loading branch information
xabbuh committed Jul 22, 2024
1 parent 6edb536 commit 68380d6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 18 deletions.
10 changes: 4 additions & 6 deletions Tests/ApplicationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down
10 changes: 4 additions & 6 deletions Tests/ConsoleEventsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down
10 changes: 4 additions & 6 deletions Tests/SignalRegistry/SignalRegistryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 68380d6

Please sign in to comment.