fix(testmanagement): enforce a hard timeout on TCG generation polling - #413
Open
SavioBS629 wants to merge 1 commit into
Open
fix(testmanagement): enforce a hard timeout on TCG generation polling#413SavioBS629 wants to merge 1 commit into
SavioBS629 wants to merge 1 commit into
Conversation
The two TCG test-generation polling loops in TCG-utils/api.ts had no wall-clock bound: - pollTestCaseDetails ran `while (!done)` and only exited on a "termination" message. - pollScenariosTestDetails ran a setInterval that was only cleared on termination, a non-200 status, or a thrown error. If the backend never emits a terminal message (stuck job, dropped message, or details streamed without a terminal event), either loop polls forever and keeps every awaiting caller alive indefinitely. Add a shared TCG_POLL_MAX_WAIT_MS (10 min) and TCG_POLL_INTERVAL_MS to TCG-utils/config.ts and enforce a hard deadline in both loops, mirroring the bounded pattern already used in poll-lca-status.ts. Add regression tests covering the timeout and the normal-termination paths. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Central YAML (base), Organization UI (inherited), Workspace UI (inherited) Review profile: ASSERTIVE Plan: Enterprise Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
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.
Problem
The two TCG test-generation polling loops in
src/tools/testmanagement-utils/TCG-utils/api.tshad no wall-clock bound:pollTestCaseDetailsranwhile (!done)and only exited when a"termination"message arrived.pollScenariosTestDetailsran asetIntervalthat was only cleared on termination, a non-200 status, or a thrown error.If the backend never emits a terminal message — a stuck job, a dropped message, or details streamed without a terminal event — either loop polls indefinitely (~every 10s) and keeps every awaiting caller alive forever.
pollTestCaseDetailsis fanned out per test-case batch andPromise.alled, so a single stuck trace hangs the whole result.Fix
TCG_POLL_MAX_WAIT_MS(10 min) andTCG_POLL_INTERVAL_MStoTCG-utils/config.ts.whileloop; a companionsetTimeoutthat clears the interval and rejects), mirroring the bounded polling pattern already used inpoll-lca-status.ts.Testing
npm run lint,tsc --noEmit, and the newtests/tools/tcg-poll-timeout.test.tspass.tfaRcaCollaboration.test.tsare present onmainand untouched by this change.🤖 Generated with Claude Code