Conversation
RunProcess polled the child with an exponential backoff that capped at 100 ms, so every test longer than roughly 300 ms paid 30-75 ms of latency after it had already exited. Across the parallel suite that adds up to about 160 thread-seconds. Block in wait() instead and let a timer thread deliver the kill when the timeout is crossed. Set the shutdown flag from the SIGINT handler so a worker whose child died from the same ctrl-c does not report it as a failure before the main thread aborts the run. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UH48w8TCtYmHd4P2UE6HEY Signed-off-by: Matteo Collina <hello@matteocollina.com>
jasnell
approved these changes
Oct 1, 2026
panva
approved these changes
Oct 1, 2026
Collaborator
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #66432 +/- ##
==========================================
- Coverage 90.39% 90.37% -0.02%
==========================================
Files 792 792
Lines 275580 275697 +117
Branches 52840 52856 +16
==========================================
+ Hits 249104 249169 +65
- Misses 16897 16937 +40
- Partials 9579 9591 +12 🚀 New features to boost your workflow:
|
joyeecheung
approved these changes
Oct 1, 2026
MoLow
approved these changes
Oct 1, 2026
Collaborator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
RunProcesspolled the child withpoll()and an exponential backoff sleep capped at 100 ms, so every test longer than roughly 300 ms paid 30-75 ms of latency after it had already exited. Measured directly against a blocking wait on asetTimeoutchild:ExecuteThis replaces the loop with a blocking
wait(); athreading.Timerdelivers the kill (SIGTERM, orSIGABRTwith--abort-on-timeout) if the timeout is crossed, andwait()then returns the post-kill exit code exactly as before. The timer is cancelled as soon as the process exits.Because workers now observe a child's exit with no delay, a child killed by the same ctrl-c that interrupts the runner could be recorded as a crashed test before the main thread set the shutdown flag, turning "Test aborted." into a "Failed tests:" list. The flag is now set from the
SIGINThandler itself so it wins that race.Parallel suite on an idle 8-core Linux box,
-j8, no failures in either run:Verified: timeout and
--abort-on-timeoutpaths (exit_code-15 / -6,timed_outset), ctrl-c three times in a row aborts immediately with no leftovernodeprocesses,pseudo-tty/message/parallelsamples pass,make lint-pyclean.AI generated, reviewed by me.