Repository navigation
Stop tracking open handles in every run - #1044
Open
exercism-agent[bot] wants to merge 1 commit into
Open
exercism-agent[bot] wants to merge 1 commit into
exercism-agent[bot] wants to merge 1 commit into
Conversation
--detectOpenHandles records a stack trace for every timer, promise and other async resource that a run creates, which took about 15% of each run. A solution that leaves a handle open still keeps Jest from exiting, as before, so the output is the same. Co-authored-by: iHiD <286476+iHiD@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Hello 🙂 I'm working with Claude to try and get our tooling faster.
This PR makes this project around 6% faster. I've run it in production to benchmark things in the real world against the most recent few hundred solutions, so I'm confident that it works robustly. However, I've not written the code. I have tried my hardest to get Claude to write sensible messages and comments that explains stuff, but I'd ask for your patience in the fact I'm sending AI code to you. Everything below here is from your friendly neighbourhood LLM...
#1045 builds on this PR and makes Jest exit as soon as the tests finish.
What changed
run.shno longer passes--detectOpenHandlesto Jest. In Jest 30, the flag records where every timer, promise and other async resource is created, so that it can print a report of any left open when the tests finish. It doesn't make Jest exit, and the runner never reads the report. The recording cost about 0.15 to 0.2s of every run.The flag was added with the switch to pnpm in #852. To check that nothing depends on it, I ran three sets of solutions through the runner with and without the flag:
setIntervalthat is never cleared, a longsetTimeout, an unhandled rejection, a callback that fires after the tests, an endless async loop, and a test that awaits something that never settles.Every one gave the same
results.json, the same exit code and the same hang behaviour with and without the flag. Six of the broken solutions leave a timer running, and both versions write the results and then wait until the 30 second timeout. #1045 fixes that.This has been tested in production, and has reduced the median run from 4.6s to 4.3s.
🤖 Generated with Claude Code