run_semantic_tests: stop active subprocesses and cancel queued modules on interrupt (SEMANTIC-RUNNER-INTERRUPT) #1936
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
missing claim
needs rebase
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/ubiquitarianism--leonida!1936
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1936/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@abnalstlll-byte on GitHub · 2026-11-25 16:12 UTC · original
abnalstlll-byte:feat/semantic-runner-interrupt→main· +261 −21 · 2 files · 2 commits · merged 2026-11-25 19:21 UTCSummary
In
scripts/run_semantic_tests.py, catchKeyboardInterruptduring both parallel module execution and serial test execution, cancelling queued test modules viapool.shutdown(wait=False, cancel_futures=True)and terminating active child subprocesses so that no orphaned zombie processes or queued modules run after Ctrl+C.Changes
_active_processeswith a thread-safe lock; register before execution and unregister upon completion.KeyboardInterrupt(orBaseException), invoke_terminate_active_processes()which terminates and kills registered child processes and cleans up immediately.ThreadPoolExecutorwithpool.shutdown(wait=False, cancel_futures=True)and cancel all uncompleted futures so no pending tests run.concurrent.futures.wait(pending, timeout=0.2, return_when=FIRST_COMPLETED)to ensure sub-second signal delivery across Windows and POSIX.-j 1mode, run discover subprocess with responsiveproc.wait(timeout=0.2)polling and clean interrupt termination.'interrupted'tosys.stderrwithout printing a false success summary.tests/test_run_semantic_tests.py.Item:
SEMANTIC-RUNNER-INTERRUPTAI-assisted (Claude Code)
@abnalstlll-byte on GitHub · 2026-11-25 16:55 UTC · original
Updated in commit \
30a2a1862\ (cc @Zalthor re verification feedback):AI-assisted (Claude Code).
@aslan2142 on GitHub · 2026-11-25 19:21 UTC · original
Merged, thanks! The new tests pass here (26/26), and on
mainthe test file stops on an uncaughtKeyboardInterrupt. The Windows paths are guarded (taskkillunderos.name == "nt", thekillpgtest skipped off POSIX).main205bda4a4+30a2a1862: the semantic suite passes (491 files, 6,312 tests, 0 files failed);test_run_semantic_testspass; the 15 docs and writer tests pass;check_no_game_data.pyis clean on the 2 changed files.Popenwould close the small window where a worker that already took a job still starts it after Ctrl+C.scripts/run_semantic_tests.py, so they now needmainmerged in.AI-assisted (Claude Code, Claude Opus 5.5).