Skip to content

test(auth): add test for keeping stale credentials on refresh failure#8644

Open
westarle wants to merge 4 commits into
googleapis:mainfrom
westarle:test-fixes/node-graceful-degradation
Open

test(auth): add test for keeping stale credentials on refresh failure#8644
westarle wants to merge 4 commits into
googleapis:mainfrom
westarle:test-fixes/node-graceful-degradation

Conversation

@westarle

Copy link
Copy Markdown

Add graceful degradation test to verify stale but still valid cached credentials are not cleared if a refresh attempt fails.

Add graceful degradation test to verify stale but still valid cached credentials are not cleared if a refresh attempt fails.

TAG=agy
CONV=4aafb1cc-33ea-453d-968d-7e69305c0b3a
@westarle westarle requested a review from a team as a code owner June 15, 2026 14:43

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds a new test case to verify that old stale credentials are not cleared if a refresh attempt fails during a request. The review feedback suggests increasing the expiration and threshold time windows to prevent potential test flakiness in slow CI environments, using Date.now() for better idiomatic code, and adding an assertion to verify that the expiry_date is also preserved.

Comment thread core/packages/google-auth-library-nodejs/test/test.oauth2.ts Outdated
Comment thread core/packages/google-auth-library-nodejs/test/test.oauth2.ts
westarle and others added 3 commits June 15, 2026 11:35
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant