You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(test): the orphan-reap assertion asked for an ordering the engine does not guarantee
`test_worker_kill_reaps_the_whole_process_tree` asserted the LATER of two events at the instant the
EARLIER one landed, and it is currently reding a REQUIRED context: PR #458's ubuntu leg failed at
tests/test_sandbox.py:998, "the grandchild survived the worker kill", and the same test failed on
`main` in run 32206563674.
THE DOCSTRING WAS THE DEFECT, NOT ONLY THE TIMING. It claimed pipe-EOF is equivalent to "grandchild
reaped". It is not, and the two observables are not the same event:
- pipe EOF fires when the last holder of the write end releases its fds -- at process EXIT;
- `os.kill(pid, 0)` raises ESRCH only once the pid is REAPED;
- the grandchild is ORPHANED, because the sandbox worker (its parent) is killed and `proc.wait()`ed
first, so pytest cannot `waitpid` it and reaping falls to PID 1 or the nearest subreaper,
asynchronously.
So t_reap is STRICTLY AFTER t_exit == t_EOF, always, and the test asserted the later one with no wait,
poll or deadline between them. It passed only when the reap won a race it was never entitled to win.
TIMING-DEPENDENT AND WRONG ARE NOT ALTERNATIVES HERE -- the ordering is guaranteed by the mechanism.
A sleep or a retry would have made it green while leaving the false equivalence in place for the next
reader to rely on again, which is why the docstring is part of the change rather than a footnote to it.
The two senses of "reap" that collide here are now stated: `_reap_process_tree` reaps in this
codebase's sense -- TERMINATE every process in the tree, which is what the engine guarantees and what
the pipe-EOF assertion genuinely proves -- while POSIX `waitpid` reaping is a different act on a
different schedule, and the test now waits for TERMINATION only. It asks for nothing the engine does
not promise.
VERIFIED: tests/test_sandbox.py -> 25 passed; the false-equivalence sentence is gone (grep returns 0);
ruff 0.15.22 clean; no cp1252-unsafe character introduced.
ITS ADVERSARIAL REVIEW HAD NOT REPORTED WHEN THIS WAS COMMITTED -- committed to protect the work across
a usage-window boundary, with any finding to be fixed forward. Nothing is pushed. The platform split
matters for whoever reads this next: the ordering argument is POSIX-shaped, and this box is Windows, so
the CI red is the behavioural evidence rather than a local reproduction.
0 commit comments