--TEST-- Killing server should terminate all worker processes --ENV-- PHP_CLI_SERVER_WORKERS=2 --SKIPIF-- --FILE-- processHandle)['pid']; $workersBefore = find_workers_by_ppid($master); if (count($workersBefore) === 0) { throw new \Exception('Could not find worker pids'); } proc_terminate($cliServerInfo->processHandle, 9); // SIGKILL $try = 1; $max_tries = 20; while (true) { $workersAfter = find_workers_by_pids($workersBefore); if (count($workersAfter) === 0) { break; } if ($try >= $max_tries) { throw new \Exception('Workers were not properly terminated. Before: ' . join(', ', $workersBefore) . ', after: ' . join(', ', $workersAfter)); } $try++; usleep(100_000); } echo 'Done'; ?> --EXPECT-- Done