-
- Downloads
testing: use monotonic counts to attribute races in subtests
This implements the approach I described in https://go-review.git.corp.google.com/c/go/+/494057/1#message-5c9773bded2f89b4058848cb036b860aa6716de3. Specifically: - Each level of test atomically records the cumulative number of races seen as of the last race-induced test failure. - When a subtest fails, it logs the race error, and then updates its parents' counters so that they will not log the same error. - We check each test or benchmark for races before it starts running each of its subtests or sub-benchmark, before unblocking parallel subtests, and after running any cleanup functions. With this implementation, it should be the case that every test that is running when a race is detected reports that race, and any race reported for a subtest is not redundantly reported for its parent. The regression tests are based on those added in CL 494057 and CL 501895, with a few additions based on my own review of the code. Fixes #60083. Change-Id: I578ae929f192a7a951b31b17ecb560cbbf1ef7a1 Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest,gotip-linux-amd64-longtest-race,gotip-windows-amd64-longtest Reviewed-on: https://go-review.googlesource.com/c/go/+/506300 Reviewed-by:Ian Lance Taylor <iant@google.com> Auto-Submit: Bryan Mills <bcmills@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Showing
- src/runtime/race/output_test.go 1 addition, 1 deletionsrc/runtime/race/output_test.go
- src/testing/benchmark.go 5 additions, 7 deletionssrc/testing/benchmark.go
- src/testing/fuzz.go 2 additions, 0 deletionssrc/testing/fuzz.go
- src/testing/testing.go 107 additions, 13 deletionssrc/testing/testing.go
- src/testing/testing_test.go 344 additions, 1 deletionsrc/testing/testing_test.go
Loading
Please register or sign in to comment