Skip to content

Commit 2b609e5

Browse files
committed
Fix run-tests.php hanging when a worker process dies without notice
run-tests.php with `-jN` can hang if a parallel worker dies without notice. This can happen due to fatal errors in the worker, or if the worker is killed. - run-tests.php (main process) \_ run-tests.php (worker #0) // main process hangs if this one crashes \_ test-001.php (test-001.phpt)
1 parent 1d67e34 commit 2b609e5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

run-tests.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1555,6 +1555,10 @@ function run_all_tests_parallel(array $test_files, array $env, $redir_tested): v
15551555
kill_children($workerProcs);
15561556
error("Could not find worker stdout in array of worker stdouts, THIS SHOULD NOT HAPPEN.");
15571557
}
1558+
if (feof($workerSock)) {
1559+
kill_children($workerProcs);
1560+
error("Worker $i died unexpectedly");
1561+
}
15581562
while (false !== ($rawMessage = fgets($workerSock))) {
15591563
// work around fgets truncating things
15601564
if (($rawMessageBuffers[$i] ?? '') !== '') {

0 commit comments

Comments
 (0)