test(auth): add test for retry exhaustion on transient errors#8645
Draft
westarle wants to merge 1 commit into
Draft
test(auth): add test for retry exhaustion on transient errors#8645westarle wants to merge 1 commit into
westarle wants to merge 1 commit into
Conversation
Add retry exhaustion test to verify client request rejects with 500 error after all transporter retries are exhausted. This brings Node.js test coverage in line with other resilient implementations (like Python, Go, Rust, and Swift) which also perform internal credential-level retries with exponential backoff on the token endpoint before ultimately exhausting and bubbling the error up. (Contrast this with Java, C++, and PHP which lack internal credential retries entirely and fail immediately on transient auth errors). TAG=agy CONV=4aafb1cc-33ea-453d-968d-7e69305c0b3a
pearigee
reviewed
Jun 15, 2026
| }, | ||
| }) | ||
| .post('/token') | ||
| .times(4) |
Contributor
There was a problem hiding this comment.
Should this be a constant or explicitly configured for this test? I think we are implicitly falling back to the default 3 retries in gaxios:
It looks like this library stores its config in this static method:
We could reference the config explictly like this:
.times(1 + OAuthClientAuthHandler.RETRY_CONFIG().retryConfig?.retry ?? 3)
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.
Add retry exhaustion test to verify client request rejects with 500 error after all transporter retries are exhausted.
This brings Node.js test coverage in line with other resilient implementations (like Python, Go, Rust, and Swift) which also perform internal credential-level retries with exponential backoff on the token endpoint before ultimately exhausting and bubbling the error up. (Contrast this with Java, C++, and PHP which lack internal credential retries entirely and fail immediately on transient auth errors).