When race.bash was originally added (back in CL 7179052), the Go compiler was still written in C and thus was not meaningful to test under the race detector.
(I'm not sure why the rest of cmd was not tested under the race detector at that point. Perhaps @davecheney remembers?)
When race.bash was gutted and moved into cmd/dist, that behavior was retained:
|
func (t *tester) shouldTestCmd() bool { |
|
if t.race { |
|
return false |
|
} |
These days, cmd includes an extensive amount of Go code, much of which includes non-trivial concurrency, and some of which exercises packages that do not themselves have race-detector tests (#32783).
I think we should be testing all of cmd under the race detector, not just std. It will increase builder latency and potentially cost more resources, but the additional benefit of testing the concurrent code in cmd seems well worth the cost.
CC @golang/osp-team @josharian @dvyukov
When
race.bashwas originally added (back in CL 7179052), the Go compiler was still written in C and thus was not meaningful to test under the race detector.(I'm not sure why the rest of
cmdwas not tested under the race detector at that point. Perhaps @davecheney remembers?)When
race.bashwas gutted and moved intocmd/dist, that behavior was retained:go/src/cmd/dist/test.go
Lines 1529 to 1532 in b3b174f
These days,
cmdincludes an extensive amount of Go code, much of which includes non-trivial concurrency, and some of which exercises packages that do not themselves have race-detector tests (#32783).I think we should be testing all of
cmdunder the race detector, not juststd. It will increase builder latency and potentially cost more resources, but the additional benefit of testing the concurrent code incmdseems well worth the cost.CC @golang/osp-team @josharian @dvyukov