Cancel Windows semantic test subprocess trees (SEMANTIC-RUNNER-WINDOWS-CHILD-CANCEL) #2071

Open
github-bot wants to merge 1 commit from github-bot/gh-2071 into main AGit
Owner

@⁠alexandersato0830 on GitHub · 2026-11-25 19:31 UTC · original
alexandersato0830:codex/semantic-runner-windows-child-cancel → main · +30 −6 · 2 files · 1 commits · open

Claimed in the coordination issue as: SEMANTIC-RUNNER-WINDOWS-CHILD-CANCEL

What and why

After #1936, interrupt cleanup terminates the parent before running Windows taskkill /T. With the parent gone, the child can continue running and keep the runner's output pipe open. Ask Windows to end the process tree while the parent is live, then fall back to killing the parent through its process handle. The Windows regression starts a synthetic descendant that inherits stdout and checks whether it survives cancellation.

Tested

  • Windows 11, Python 3.14.9. On main e48ff03 the descendant lived long enough to write its completion marker to the pipe. With the fix the regression passed.
  • py -3.14 -I tests/test_run_semantic_tests.py ran 27 cases successfully with the POSIX signal case skipped.
  • Parallel semantic CLI smoke with test_library_compute_forms.py passed (12 tests).
  • Verified git diff --check and the source-only check.

GPUs tested: n/a.

AI-assisted: yes.

  • Based on current main.
  • One topic.
  • Uses source and synthetic fixtures.
**@⁠alexandersato0830** on GitHub · 2026-11-25 19:31 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2071) `alexandersato0830:codex/semantic-runner-windows-child-cancel` → `main` · +30 −6 · 2 files · 1 commits · open Claimed in the coordination issue as: [SEMANTIC-RUNNER-WINDOWS-CHILD-CANCEL](https://git.gtahub.st/github/ubiquitarianism--leonida/issues/1608) ### What and why After #1936, interrupt cleanup terminates the parent before running Windows `taskkill /T`. With the parent gone, the child can continue running and keep the runner's output pipe open. Ask Windows to end the process tree while the parent is live, then fall back to killing the parent through its process handle. The Windows regression starts a synthetic descendant that inherits stdout and checks whether it survives cancellation. ### Tested - Windows 11, Python 3.14.9. On main `e48ff03` the descendant lived long enough to write its completion marker to the pipe. With the fix the regression passed. - `py -3.14 -I tests/test_run_semantic_tests.py` ran 27 cases successfully with the POSIX signal case skipped. - Parallel semantic CLI smoke with `test_library_compute_forms.py` passed (12 tests). - Verified `git diff --check` and the source-only check. GPUs tested: n/a. AI-assisted: yes. - [x] Based on current `main`. - [x] One topic. - [x] Uses source and synthetic fixtures.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 10:16:49 +00:00
Author
Owner

@⁠MSedgeMC on GitHub · 2026-11-25 19:35 UTC · original · approved these changes

Verified on the PR branch: python3 -m unittest tests.test_run_semantic_tests -> 27 tests OK (1 skipped — the new Windows descendant-kill test is guarded by @⁠skipUnless(os.name=='nt'), which cannot execute on this Linux host). The fix is sound: on Windows, taskkill /F /T needs the root alive, so it no longer pre-terminates processes with p.terminate(), and _kill_process_tree is skipped when the root has already exited; POSIX termination behaviour is unchanged. Advisory: branch carries ~60 older commits not on current main; rebase before merge.

**@⁠MSedgeMC** on GitHub · 2026-11-25 19:35 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2071#pullrequestreview-6063820745) · **approved these changes** Verified on the PR branch: python3 -m unittest tests.test_run_semantic_tests -> 27 tests OK (1 skipped — the new Windows descendant-kill test is guarded by @⁠skipUnless(os.name=='nt'), which cannot execute on this Linux host). The fix is sound: on Windows, taskkill /F /T needs the root alive, so it no longer pre-terminates processes with p.terminate(), and _kill_process_tree is skipped when the root has already exited; POSIX termination behaviour is unchanged. Advisory: branch carries ~60 older commits not on current main; rebase before merge.
Author
Owner

@⁠DeadlyChirp on GitHub · 2026-11-26 10:01 UTC · original · edited 2026-11-26 10:30 UTC

Tested on Windows 11, Python 3.12.10, with this PR merged onto current upstream main.

  • tests/test_run_semantic_tests.py: 26 passed, 1 skipped (the POSIX process-group SIGINT test), 33 subtests passed. On main the same file has 25 tests, all passing.

(AI-assisted test run; output checked by hand.)

**@⁠DeadlyChirp** on GitHub · 2026-11-26 10:01 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2071#issuecomment-7188795180) · edited 2026-11-26 10:30 UTC Tested on Windows 11, Python 3.12.10, with this PR merged onto current upstream main. - `tests/test_run_semantic_tests.py`: 26 passed, 1 skipped (the POSIX process-group SIGINT test), 33 subtests passed. On main the same file has 25 tests, all passing. (AI-assisted test run; output checked by hand.)
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2071/head:github-bot/gh-2071'
git switch 'github-bot/gh-2071'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2071'
git switch 'github-bot/gh-2071'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2071'
git switch 'github-bot/gh-2071'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2071'
git switch 'main'
git merge --squash 'github-bot/gh-2071'
git switch 'main'
git merge --ff-only 'github-bot/gh-2071'
git switch 'main'
git merge 'github-bot/gh-2071'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.