diff --git a/ext/pcntl/tests/gh11498.phpt b/ext/pcntl/tests/gh11498.phpt index a9dc784ff6a..4a9f87a94d8 100644 --- a/ext/pcntl/tests/gh11498.phpt +++ b/ext/pcntl/tests/gh11498.phpt @@ -19,7 +19,8 @@ pcntl_signal(SIGCHLD, function($sig, $info) use (&$processes) { }, false); for ($i = 0; $i <= 5; $i++) { - $process = proc_open('echo $$ > /dev/null', [], $pipes); + // Sleeping ensures we get to add the process to the list before the signal is invoked. + $process = proc_open('sleep 1', [], $pipes); $pid = proc_get_status($process)['pid']; $processes[$pid] = $process; }