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: remove shared mutable state between oidc tests#17179

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

Merged
ethanndickson merged 1 commit intomainfromethan/fix-oidc-race-flake
Apr 1, 2025

Conversation

ethanndickson
Copy link
Member

@ethanndicksonethanndickson commentedApr 1, 2025
edited
Loading

Spotted on main:https://github.com/coder/coder/actions/runs/14179449567/job/39721999486

=== FAIL: coderd TestOIDCDomainErrorMessage/MalformedEmailErrorOmitsDomains (0.01s)==================WARNING: DATA RACERead at 0x00c060b54e68 by goroutine 296485:  golang.org/x/oauth2.(*Config).Exchange()      /home/runner/go/pkg/mod/golang.org/x/oauth2@v0.28.0/oauth2.go:228 +0x1d8  github.com/coder/coder/v2/coderd.(*OIDCConfig).Exchange()      <autogenerated>:1 +0xb7  github.com/coder/coder/v2/coderd.New.func11.12.1.2.ExtractOAuth2.1.1()      /home/runner/work/coder/coder/coderd/httpmw/oauth2.go:168 +0x7b5  net/http.HandlerFunc.ServeHTTP()      /opt/hostedtoolcache/go/1.24.1/x64/src/net/http/server.go:2294 +0x47[...]Previous write at 0x00c060b54e68 by goroutine 55730:  github.com/coder/coder/v2/coderd/coderdtest/oidctest.(*FakeIDP).SetRedirect()      /home/runner/work/coder/coder/coderd/coderdtest/oidctest/idp.go:1280 +0x1e6  github.com/coder/coder/v2/coderd/coderdtest/oidctest.(*FakeIDP).LoginWithClient()      /home/runner/work/coder/coder/coderd/coderdtest/oidctest/idp.go:494 +0x170  github.com/coder/coder/v2/coderd/coderdtest/oidctest.(*FakeIDP).AttemptLogin()      /home/runner/work/coder/coder/coderd/coderdtest/oidctest/idp.go:479 +0x624  github.com/coder/coder/v2/coderd_test.TestOIDCDomainErrorMessage.func3()      /home/runner/work/coder/coder/coderd/userauth_test.go:2041 +0x1f2

As seen, this race was caused by sharing a*oidctest.FakeIDP between test cases. The fix is to simply do the setup twice.

$ go test -race -run "TestOIDCDomainErrorMessage" github.com/coder/coder/v2/coderd -count=100ok      github.com/coder/coder/v2/coderd        7.551s

@ethanndicksonGraphite App
Copy link
MemberAuthor

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

@ethanndicksonethanndickson marked this pull request as ready for reviewApril 1, 2025 02:18
@ethanndicksonethanndickson merged commit3a243c1 intomainApr 1, 2025
39 checks passed
@ethanndicksonethanndickson deleted the ethan/fix-oidc-race-flake branchApril 1, 2025 11:28
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsApr 1, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

@mafredrimafredrimafredri approved these changes

Assignees

@ethanndicksonethanndickson

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@ethanndickson@mafredri

[8]ページ先頭

©2009-2025 Movatter.jp