Repository navigation
semantic tests: stop POSIX worker helpers when a test times out - #2201
EdenBendheim wants to merge 1 commit into
Conversation
…ER-POSIX-CHILD-TIMEOUT)
lixonik
left a comment
There was a problem hiding this comment.
Both new POSIX tests passed on Ubuntu 22.04 under WSL. I checked one remaining pipe-lifetime case separately. AI-assisted.
| # A launcher can exit while a helper still owns a copy of its output pipe. The session's group ID is | ||
| # the original worker PID even after the launcher exits. | ||
| try: | ||
| os.killpg(proc.pid, signal.SIGKILL) |
There was a problem hiding this comment.
[P3] Bound the pipe drain after sending the group kill. A helper that deliberately starts its own session can inherit the worker's stdout and stderr. The helper is outside the stated kill scope, but the second, unbounded proc.communicate() still waits for its pipes. A synthetic parallel worker with a detached helper that sleeps 2.5 s took 2.66 s to return for --timeout 0.5. A long-lived helper can hold the runner open indefinitely. Could the timeout path give the pipes a bounded drain without terminating the detached helper?
|
Tested
So on macOS too, the timeout now returns at the timeout instead of when the helper exits. AI-assisted (Claude Code). No game data. |
|
Tested on Windows 11, Python 3.12.10, with this PR merged onto current upstream main.
(AI-assisted test run; output checked by hand.) |
Claimed in the coordination issue as: SEMANTIC-RUNNER-POSIX-CHILD-TIMEOUT (claim)
On POSIX, a timed-out test could leave a helper holding its output pipes open. The parallel runner killed the worker and then waited for the helper to close the pipe. A 0.3-second timeout in a synthetic fixture returned after 3.13 seconds.
Timed workers now get their own process group. The timeout handler stops that group so pipe collection can finish. Untimed workers keep the caller's process group. Helpers that explicitly detach from the timed group are outside the cleanup boundary.
Depends on: #2073, #2114 (textual conflicts at the worker launch sites). All three changes can be implemented independently. The second PR to land will need to reconcile the launch arguments. Simulated merges with #2071 and #2135 were clean.
Three synthetic timeout cases reproduced the failure on main
a73a57e13, including a worker that had already exited. With the fix, the parallel 0.3-second probe completed in about 0.35 seconds. All 28 runner tests passed on macOS, including checks for untimed serial and parallel worker process groups. Compile, diff and changed-file game-data checks passed.GPUs tested: n/a. All tests used synthetic inputs.
AI-assisted: yes. Created with gpt-6.2-astra in Codex.