fix(rerun): preserve exit code and escalate auth errors in batch rerun#33
Open
crypticsaiyan wants to merge 1 commit into
Open
fix(rerun): preserve exit code and escalate auth errors in batch rerun#33crypticsaiyan wants to merge 1 commit into
crypticsaiyan wants to merge 1 commit into
Conversation
pollAccepted in runTestRerun hardcoded exitCode:1 on ApiError, causing the auth-escalation find(r => r.error?.exitCode === 3) to always return undefined -- auth failures silently exited 1 instead of 3. - preserve err.exitCode in pollAccepted (mirrors runTestRunAll fix) - add auth escalation block before generic exit-1 throw - bound initial chunk idempotency key to <=256 chars (mirrors retry path)
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.
Summary
runTestRerun'spollAcceptedhardcodedexitCode: 1on everyApiErrorduring run polling. The batch aggregator detects auth failures viarerunResults.find(r => r.error?.exitCode === 3). With every error stored asexitCode: 1, auth errors were never escalated and the batch always exited 1 instead of 3.The sibling function
runTestRunAllalready had both fixes applied.runTestRerunmissed them.The Fix
pollAcceptednow storesexitCode: err.exitCodeinstead of hardcoded1, so the aggregator sees the real error class from each polling failure.authErrcheck before the generic exit-1 throw: any batch member withexitCode: 3(AUTH_REQUIRED/AUTH_INVALID) escalates the whole batch to exit 3 with an actionable message.base + :chunkNnever exceeds 256 chars, matching the identical guard already present in the deferred-retry path.Testing
Added 9 tests to
src/commands/test.rerun.spec.tsacross three describe blocks:[fix-exitcode]:AUTH_REQUIREDescalates to exit 3;RATE_LIMITEDandNOT_FOUNDremain exit 1 (no spurious escalation)[fix-auth-escalation]: auth failure exits 3; mixed pass+auth batch exits 3; non-auth failure exits 1[fix-D4]: short key passes through unchanged; 249-char key fits exactly at 256; 256-char key truncated to preserve suffixFiles Changed
src/commands/test.tssrc/commands/test.rerun.spec.ts