fix(coderd): isolate OIDC fake IDP in parallel subtests#26075
Merged
Conversation
ThomasK33
approved these changes
Jun 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ENG-2833 reported
TestPatchChat/PlanMode/*andTestProvisionerJobs/ProvisionerJobs/Single/*as race failures. Re-fetching the full job log showed those tests only hadtesting.go:1712: race detected during execution of testafter the package-level race detector had already reported stacks fromTestUserOIDC/OIDCEmailFallbackBlockedByExistingLink.The race stack reads
oauth2.Config.AuthCodeURLthroughcoderd/httpmw/oauth2.gowhile another parallel OIDC subtest writes the same fake IDP redirect URL throughoidctest.FakeIDP.SetRedirect. This moves theoidctest.FakeIDPsetup into each parallel table subtest so plan chat and provisioner job tests are no longer collateral failures from the shared OIDC fake.Closes ENG-2833
Coder Agents generated context
Generated by Coder Agents.
Relevant original CI log evidence:
WARNING: DATA RACEat lines 1515, 1737, 1965, and 2193 of the fetched job log.golang.org/x/oauth2.(*Config).AuthCodeURL()throughcoderd/httpmw/oauth2.go:156.coderd/coderdtest/oidctest.(*FakeIDP).SetRedirect()fromLoginWithClient()inTestUserOIDC/OIDCEmailFallbackBlockedByExistingLink.TestPatchChat/PlanMode/*andTestProvisionerJobs/ProvisionerJobs/Single/*only containtesting.go:1712: race detected during execution of test.Local validation:
go test -race ./coderd -run 'TestUserOIDC/OIDCEmailFallbackBlockedByExistingLink' -count=50 -failfast -vgo test -race ./coderd -run '^(TestUserOIDC|TestPatchChat|TestProvisionerJobs)$/((OIDCEmailFallbackBlockedByExistingLink)|(PlanMode|Title)|(ProvisionerJobs))' -count=20 -failfastmake lint