Skip to content

test(auth): resolve flakiness in ClientSideCredentialAccessBoundaryFactoryTest#13433

Merged
lqiu96 merged 1 commit into
googleapis:mainfrom
lqiu96:fix/cab-token-flakiness
Jun 11, 2026
Merged

test(auth): resolve flakiness in ClientSideCredentialAccessBoundaryFactoryTest#13433
lqiu96 merged 1 commit into
googleapis:mainfrom
lqiu96:fix/cab-token-flakiness

Conversation

@lqiu96

@lqiu96 lqiu96 commented Jun 11, 2026

Copy link
Copy Markdown
Member

Fixes: #12871

Synchronize the decision to refresh and task creation to avoid race conditions.

@lqiu96 lqiu96 requested a review from jinseopkim0 June 11, 2026 17:17

@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 addresses a race condition in ClientSideCredentialAccessBoundaryFactory by synchronizing the token refresh decision and task creation, and re-enables a previously disabled multi-threaded test. The reviewer suggests optimizing performance by using a double-checked locking pattern with an explicit lock (such as ReentrantLock) instead of the synchronized block on the hot path to avoid unnecessary lock contention when no refresh is needed.

@lqiu96 lqiu96 force-pushed the fix/cab-token-flakiness branch 2 times, most recently from fe5fb32 to 4cdb67c Compare June 11, 2026 17:30
…toryTest

Synchronize the decision to refresh and task creation to avoid race conditions. Use Double-Checked Locking to minimize lock contention on the hot path.

Resolves: googleapis#12871
@lqiu96 lqiu96 force-pushed the fix/cab-token-flakiness branch from 4cdb67c to 83b1a5b Compare June 11, 2026 17:43
@lqiu96 lqiu96 marked this pull request as ready for review June 11, 2026 17:50
@lqiu96 lqiu96 requested review from a team as code owners June 11, 2026 17:50
@lqiu96 lqiu96 merged commit 6a538a0 into googleapis:main Jun 11, 2026
297 of 300 checks passed
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.

[google-auth-library-java] Flaky Test: ClientSideCredentialAccessBoundaryFactoryTest.refreshCredentialsIfRequired_asyncMultiThread

2 participants