Repository navigation
Exit Jest once the tests finish, even if the solution leaves timers running - #1045
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
…unning A solution that leaves a timer or interval running kept Jest from exiting, so the run waited for the container's 30 second timeout after the results were already written. --forceExit makes Jest exit as soon as the tests finish. The results are the same. Co-authored-by: iHiD <286476+iHiD@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 23, 2026
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 stops runs from hanging until the timeout when a solution leaves a timer running. 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...
This PR builds on #1044. Merge #1044 first.
What changed
If a solution leaves a timer or interval running (for example a
setIntervalthat is never cleared), Jest finishes the tests and writes the results, but Node keeps running. The run then waits until the container's 30 second timeout. The student still gets the results, but only after the full 30 seconds.run.shnow passes--forceExit, so Jest exits as soon as the tests finish. In the broken solutions tested for #1044, the six that leave a timer running now finish in 2 to 3 seconds, with the sameresults.json. Every other solution in those tests, including the 210 recent student solutions, gave the same results as before.This has been tested in production, and has reduced runs that leave a timer running from 31s to 3s.
🤖 Generated with Claude Code