CI Run Link: https://github.com/coder/coder/actions/runs/25064499796
Failing Job: https://github.com/coder/coder/actions/runs/25064499796/job/73427821848 (test-go-race-pg)
Commit: 3f0e015fe53dca6172ebf31feafa30756ae980f8 (George K) coder/coder@3f0e015
Failure summary:
coderd/healthcheck/derphealth TestDERP subtests (STUNOnly/NoStun, NoDERP/EmptyMap, STUNOnly/WarnsNoDERP, STUNOnly/OneBadOneGood) failed with race detector output.
testing.go:1617: race detected during execution of test
Race detection evidence:
WARNING: DATA RACE
Read at 0x00c0004aca28 by goroutine 257:
github.com/coder/coder/v2/coderd/healthcheck/derphealth.(*Report).Run.func1()
/home/runner/work/coder/coder/coderd/healthcheck/derphealth/derp.go:112 +0x24b
Previous write at 0x00c0004aca28 by goroutine 36:
github.com/coder/coder/v2/coderd/healthcheck/derphealth.(*Report).Run()
/home/runner/work/coder/coder/coderd/healthcheck/derphealth/derp.go:118 +0x7f8
github.com/coder/coder/v2/coderd/healthcheck/derphealth_test.TestDERP.func7()
/home/runner/work/coder/coder/coderd/healthcheck/derphealth/derp_test.go:392 +0x4aa
Root cause assessment:
- Data race in
coderd/healthcheck/derphealth.Report.Run between the goroutine that appends to r.Warnings under the local mutex and the main goroutine that appends the no DERP nodes warning without holding the same lock when !hasDERP.
- Likely introduced by the recent change adding the no-DERP warning in
derp.go.
Assignment analysis:
- Targeted blame (not available via current tooling):
git blame -L 106,118 coderd/healthcheck/derphealth/derp.go
git blame -L 367,410 coderd/healthcheck/derphealth/derp_test.go
github_list_commits for coderd/healthcheck/derphealth/derp.go and derp_test.go shows the most recent meaningful change is commit 3f0e015fe53d (George K), which added the no-DERP warning and touched TestDERP.
- Unable to map George K to a GitHub username via the API; assigning to @johnstcn as a long-term owner of the derphealth area (multiple recent commits) for triage.
Related issues search (coder/internal):
- "derphealth" "data race"
- "TestDERP" "race detected"
- "WARNING: DATA RACE" derp
- "STUNOnly" "NoStun"
- No direct duplicates found.
Reproduction:
go test ./coderd/healthcheck/derphealth -run TestDERP -race -count=50
CI Run Link: https://github.com/coder/coder/actions/runs/25064499796
Failing Job: https://github.com/coder/coder/actions/runs/25064499796/job/73427821848 (test-go-race-pg)
Commit: 3f0e015fe53dca6172ebf31feafa30756ae980f8 (George K) coder/coder@3f0e015
Failure summary:
coderd/healthcheck/derphealth TestDERPsubtests (STUNOnly/NoStun,NoDERP/EmptyMap,STUNOnly/WarnsNoDERP,STUNOnly/OneBadOneGood) failed with race detector output.testing.go:1617: race detected during execution of testRace detection evidence:
Root cause assessment:
coderd/healthcheck/derphealth.Report.Runbetween the goroutine that appends tor.Warningsunder the local mutex and the main goroutine that appends theno DERP nodeswarning without holding the same lock when!hasDERP.derp.go.Assignment analysis:
git blame -L 106,118 coderd/healthcheck/derphealth/derp.gogit blame -L 367,410 coderd/healthcheck/derphealth/derp_test.gogithub_list_commitsforcoderd/healthcheck/derphealth/derp.goandderp_test.goshows the most recent meaningful change is commit 3f0e015fe53d (George K), which added the no-DERP warning and touched TestDERP.Related issues search (coder/internal):
Reproduction:
go test ./coderd/healthcheck/derphealth -run TestDERP -race -count=50