Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: add retry logic to OAuth2 metadata tests to avoid race conditions#19813

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

ThomasK33
Copy link
Member

@ThomasK33ThomasK33 commentedSep 15, 2025
edited
Loading

This PR adds a readiness wait to OAuth2 metadata endpoint tests to avoid rare races with server startup. Instead of immediately making HTTP requests, the tests now usetestutil.Eventually to retry the requests until they succeed, with a short interval between attempts. This helps prevent flaky tests that might fail due to timing issues during server initialization.

Fixes:coder/internal#996

@ThomasK33Graphite App
Copy link
MemberAuthor

This stack of pull requests is managed byGraphite. Learn more aboutstacking.

@ThomasK33ThomasK33force-pushed thethomask33/09-12-test_oauth2provider_deflake_oauth2_metadata_tests_with_readiness_wait branch from652ebde to0f8cad1CompareSeptember 15, 2025 07:55
@ThomasK33ThomasK33 marked this pull request as ready for reviewSeptember 15, 2025 07:57
Fix flake in TestOAuth2AuthorizationServerMetadata by polling the .well-known endpoints until they return 200 and valid JSON, using testutil.Eventually.Root cause: the test server can accept requests before the real handler is installed in coderdtest, returning 200 with an empty body which causes JSON decode EOF. The readiness loop avoids this race without sleeps and holds under t.Parallel().This fixes the following issue:coder/internal#996Change-Id: I466815d35f03bb75ef448d6f3431cd4b6efe2570Signed-off-by: Thomas Kosiewski <tk@coder.com>
@ThomasK33ThomasK33force-pushed thethomask33/09-12-test_oauth2provider_deflake_oauth2_metadata_tests_with_readiness_wait branch from0f8cad1 to1312cd9CompareSeptember 22, 2025 16:15
@ThomasK33ThomasK33 merged commit6fb4cc6 intomainSep 22, 2025
32 checks passed
@ThomasK33ThomasK33 deleted the thomask33/09-12-test_oauth2provider_deflake_oauth2_metadata_tests_with_readiness_wait branchSeptember 22, 2025 16:30
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsSep 22, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@johnstcnjohnstcnjohnstcn approved these changes

Assignees

@ThomasK33ThomasK33

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Flaky Test: TestOAuth2AuthorizationServerMetadata
2 participants
@ThomasK33@johnstcn

[8]ページ先頭

©2009-2025 Movatter.jp