Skip to content

Commit 5cb9e72

Browse files
committed
Fix pdeathsig test on FreeBSD
For FreeBSD a small usleep is required to make sure the processes have time to terminate. Closes GH-9506
1 parent 5f526c1 commit 5cb9e72

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

sapi/cli/tests/php_cli_server_pdeathsig.phpt

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,18 @@ include "php_cli_server.inc";
2828
$cliServerInfo = php_cli_server_start('');
2929

3030
$master = proc_get_status($cliServerInfo->processHandle)['pid'];
31-
$workers = find_workers_by_ppid($master);
32-
if (count($workers) === 0) {
31+
$workersBefore = find_workers_by_ppid($master);
32+
if (count($workersBefore) === 0) {
3333
throw new \Exception('Could not find worker pids');
3434
}
3535

3636
proc_terminate($cliServerInfo->processHandle, 9); // SIGKILL
3737

38-
$workers = find_workers_by_pids($workers);
39-
if (count($workers) !== 0) {
40-
throw new \Exception('Workers were not properly terminated');
38+
usleep(10000);
39+
40+
$workersAfter = find_workers_by_pids($workersBefore);
41+
if (count($workersAfter) !== 0) {
42+
throw new \Exception('Workers were not properly terminated. Before: ' . join(', ', $workersBefore) . ', after: ' . join(', ', $workersAfter));
4143
}
4244

4345
echo 'Done';

0 commit comments

Comments
 (0)