Thanks to visit codestin.com
Credit goes to github.com

Skip to content

test(cli): bind GitHub OAuth tests to loopback - #28980

Merged
hugodutka merged 2 commits into
mainfrom
fix/eng-3285-oauth-loopback-listener
Sep 7, 2026
Merged

test(cli): bind GitHub OAuth tests to loopback#28980
hugodutka merged 2 commits into
mainfrom
fix/eng-3285-oauth-loopback-listener

Conversation

@hugodutka

@hugodutka hugodutka commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

On macOS, the Coder test server listening on all addresses could share a port with another test’s loopback listener. Go enables SO_REUSEADDR by default, allowing overlapping addresses such as [::]:61025 and 127.0.0.1:61025. The OAuth test’s SDK connects to 127.0.0.1:61025, so its requests could reach the other server and report GitHub authentication as disabled despite the intended server being correctly configured.

Bind the GitHub OAuth default-provider tests to 127.0.0.1:0, matching the SDK’s address and preventing this overlap. Remove the retries introduced in #28358 and #28622: they were unnecessary to fix the flake.

To test this fix, I had an agent connect to a live GitHub macOS runner with wush, reproduce the flake, and verify the new changes actually resolve it.

Refs https://linear.app/codercom/issue/ENG-3285/flake-testserveroauth2githubdefaultprovidernewdeployment

Generated by Coder Agents on behalf of @hugodutka.

@linear-code

linear-code Bot commented Sep 4, 2026

Copy link
Copy Markdown

ENG-3285

@hugodutka
hugodutka force-pushed the fix/eng-3285-oauth-loopback-listener branch 5 times, most recently from 22caa6d to 83c7a67 Compare September 7, 2026 12:29
Comment thread cli/server_test.go
"--postgres-url", dbURL,
"--http-address", ":0",
// Match the client's loopback address to avoid overlapping wildcard listeners on macOS.
"--http-address", "127.0.0.1:0",

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is the only new change in this PR. The rest is reverting previous PRs that introduced ineffective fixes.

@hugodutka
hugodutka marked this pull request as ready for review September 7, 2026 12:30
@hugodutka
hugodutka requested a review from johnstcn September 7, 2026 12:34

@johnstcn johnstcn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🎉

@hugodutka
hugodutka enabled auto-merge (squash) September 7, 2026 12:37
@hugodutka
hugodutka merged commit 1ecb834 into main Sep 7, 2026
85 of 87 checks passed
@hugodutka
hugodutka deleted the fix/eng-3285-oauth-loopback-listener branch September 7, 2026 13:09
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 7, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants