mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-27 00:30:52 +01:00
[PR #1936] [MERGED] run_semantic_tests: stop active subprocesses and cancel queued modules on interrupt (SEMANTIC-RUNNER-INTERRUPT) #1942
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#1942
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/1936
Author: @abnalstlll-byte
Created: 11/25/2026
Status: ✅ Merged
Merged: 11/25/2026
Merged by: @aslan2142
Base:
main← Head:feat/semantic-runner-interrupt📝 Commits (2)
542c046run_semantic_tests: stop active subprocesses and cancel queued modules on interrupt (SEMANTIC-RUNNER-INTERRUPT)30a2a18run_semantic_tests: terminate process tree on Windows via taskkill and increase sleep margin (SEMANTIC-RUNNER-INTERRUPT)📊 Changes
2 files changed (+261 additions, -21 deletions)
View changed files
📝
scripts/run_semantic_tests.py(+134 -21)📝
tests/test_run_semantic_tests.py(+127 -0)📄 Description
Summary
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)
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.