3 ms·
The go race detector (go test -race) is actually really good at finding these kinds of issues, regardless of GOMAXPROCS. I've gotten a lot more value from runni
by bdarnell 12y ago
The go race detector (go test -race) is actually really good at finding these kinds of issues, regardless of GOMAXPROCS. I've gotten a lot more value from running my tests with the race detector in a single process than running the tests with multiple processes and hoping to encounter thread-safety issues in a debuggable way.
- spullara 12y agoSeems like you should probably never run the tests with -race. Is there a downside from that being the default?
- bdarnell 12y agoThe only real downside is that it slows things down quite a bit (30s vs 12s for a full test run in my current project; I've seen both better and worse ratios in other projects). I've also seen a project that made heavy use of generated code and a race-enabled build would choke on the very large source files. But overall I agree that it seems worthwhile to make -race the default.