Skip to content

Stop isolated Windows test descendants after module exit - #4683

Merged
Mister-Meeseeks merged 1 commit into
CrocSwap:mainfrom
mihir-s-05:codex/isolated-windows-job-cleanup
Oct 22, 2026
Merged

Mister-Meeseeks merged 1 commit into
CrocSwap:mainfrom
mihir-s-05:codex/isolated-windows-job-cleanup

Conversation

@mihir-s-05

@mihir-s-05 mihir-s-05 commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Change and mathematical scope

A completed isolated unittest module can leave child/grandchild solvers alive on Windows. If those descendants retain capture pipes, the runner can also hang after the module exits. This repair gives each Windows module a private supervisor that reuses the existing gated Job Object implementation in research_package.py, preserving captured output, exit codes, completion receipts and cancellation/deadline behavior.

The production change is 31 lines; the remaining changes add native process-handle controls, adapt sandbox dependencies/fault injection, and document evidence. Supervisor/gate startup remains inside the module budget; healthy Windows deadline fixtures allow three seconds instead of one. No native ownership implementation is duplicated. This is verifier tooling, with no new κ or selected-frontier change.

Task and overlap

Base and submission refresh: canonical main b58ad9ef4d4e861b0eaa5dba41742bdc072dca51, priority revision 7. Contribution head: 02d43658b948db1922a23369b1fa2ba9bc4f8f58. Selected conditional κ remains 0.00302015.

portable-replay, scope refined to one Windows process-lifetime failure (chooser nonce 8fd33b1202dd34fd71d3e95ffb8161f5, scope key 831cc1a3c8f9ff01b197). This takes the explicit Windows follow-up to #2906, coordinated in Discussion #1472. It applies #2469's registered-runner ownership to the distinct isolated-runner caller, retaining #2625's cancellation and #2579's completion guarantees.

The final overlap refresh covered 450 open PR bodies, 3,612 Discussion records and all 5,860 in-scope local notes, with complete reported pagination and no coverage warnings. It found the predecessor handoff and this claim, with no overlapping open implementation located. This is not an exhaustive diff or closed-PR search. Exact base-source hashes, commands and limitations are in the evidence note.

Validation

  • Native Windows 11 / CPython 3.12.0: all 50 focused runner cases have expected outcomes (42 passed, eight POSIX-only skips). The six native lifetime controls also pass under -O.
  • Ubuntu/WSL2 / CPython 3.12.3: 50 focused cases, 43 passed and seven Windows-only skips.
  • Before the repair, success/failure fixtures retain live descendants and the inherited-pipe fixture exceeds its 15-second external bound despite a five-second module deadline. Joined completion passes.
  • Removing the supervisor restores both exit leaks. Other controls cover actual supervisor-only termination, timeout, cancellation, worker exceptions, taskkill races/rejection, output bytes, queued work, stale bytecode and premature zero exits.
  • git diff --check passes. Reused native code and frozen inputs are unchanged.
python -B -m unittest discover -s tests -p 'test_isolated_test_*.py' -v
python -O -B -m unittest discover -s tests -p test_isolated_test_windows_exit.py -v

The broader 57-test Windows attempt retains five failing historical-wrapper methods (16 failed assertions/subtests), all stopping at the existing Unrecognized live source update: scripts/partial_swap/shared.py check. A separate exact 16-file export of unchanged main reproduces all 16 failure headers and reasons. Their acceptance pins are not relaxed. No green full-suite, selected cold replay, hosted CI or mathematical-proof result is claimed.

Hosted verification update after publication: run 39808873242 completed with two successful package replays (isolated-descendant-bytecode and isolated-test-bytecode) and one failure (isolated-runner-successor). The failed job stops at working source drift: certificates/selected-result.json, before running its verification commands. Its unchanged source manifest pins blob b1fea0c94436b236cc2b7d41a7be032811b94c81; both canonical main b58ad9ef and this PR contain blob c35482cd9035843b15a634cc8276a7e1e40e8395. The manifest, selected record and package runner have no diff from main. This establishes that the reported pin mismatch predates the PR; it does not claim the remainder of that package passes. Its frozen source inventory also pins the pre-change isolated runner, so any successor admission needs its own source review. No acceptance pin or frontier file is changed, and no green overall hosted run is claimed.

Credit

Credit Nick Petalas/#2906, ywz65/#2469/#2625/#2579, Paul Romeo, Aaron Wang/navinor, woklerx, Douglas Colkitt, Tekalign and the retained bytecode/timeout contributors. Prepared for Mihir Srivastava (@mihir-s-05) with substantial OpenAI Codex assistance, one agent. Apache-2.0; no independent human review claimed.

Open next questions

Run the six native controls on Windows Python 3.14. Separately audit abrupt supervisor death before job assignment; test work cannot pass the gate before ownership, but an interrupted unassigned gate waiter has its own 30-second timeout. External process-launch mechanisms, hostile containment and denied native APIs are outside this contribution. Test modules must still join proof-relevant children and propagate their failures; cleanup does not verify unfinished work. The historical source-pin mismatch requires its own source review.

Reuse the registered replay runner gated Job Object, preserve module results and deadlines, and add native lifetime controls. Prepared with substantial OpenAI Codex assistance.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants