Repository navigation
fix(coderd/coderdtest): read the swagger doc once in TestSwaggerEnumsNotNarrowed - #32065
Conversation
|
@codex review |
|
@codex security review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Chef's kiss. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
🛡️ Codex Security ReviewSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
Why
The
test-go-race-pgjob fails intermittently withWARNING: DATA RACEinswag.(*Spec).ReadDoc, on pull requests whose changes do not cause it. It failed CI runs 43102680650 and 43103681536 on two unrelated pull requests. A green rerun of the same commit passes, so it hides as a flake.Cause
swag's
Spec.ReadDocwrites shared state, so parallel tests that each call it race. #31829 addressed this by reading the spec once throughswaggerDoc, async.OnceValue. #30122 then addedTestSwaggerEnumsNotNarrowedwith a directapidoc.SwaggerInfo.ReadDoc()call, which races with the tests that still read the shared value.What changed
TestSwaggerEnumsNotNarrowedcallsswaggerDoc(), like the other tests. It was the only direct call outside the generatedcoderd/apidoc/docs.go.Reproduction
main(412d998),go test -race -count=20 -run 'TestSwagger|TestChatModelPathParametersFormatted' ./coderd/coderdtest/fails with 2 data race reports.TestChatModelPathParametersFormatted,TestSwaggerParametersValidandTestSwaggerEnumsNotNarrowedfail.Generated with
xum• Model:anthropic:claude-sonnet-5-5• Thinking:xhigh