]> Cypherpunks.ru repositories - gostls13.git/commit
testing: only report subtest races once
authorIan Lance Taylor <iant@golang.org>
Tue, 9 May 2023 22:10:26 +0000 (15:10 -0700)
committerGopher Robot <gobot@golang.org>
Wed, 24 May 2023 04:06:14 +0000 (04:06 +0000)
commit5b93af7f4f61ccc7d770ee24641b2fd9c71c0329
tree476170b0c3a76252d68c7d16707c584123861a37
parent298fe517a9333c05143a8a8e1f9d5499f0c6e59b
testing: only report subtest races once

Before this CL the code would record the number of race detector
errors seen before starting a test, and then report an error
if there were more race detector errors after the test completed.
That approach did not work well for subtests or parallel tests.
Race detector errors could be reported multiple times at each
level of subtest, and parallel tests could accidentally drop
race detector errors.

Instead, report each race detector error at most once, associated
with whatever test noticed the new error. This is still imperfect,
as it may report race detector errors for the wrong parallel test.
But it shouldn't drop any errors entirely, and it shouldn't report
any errors more than once.

Fixes #60083

Change-Id: Ic9afea5c692b6553896757766f631cd0e86192ad
Reviewed-on: https://go-review.googlesource.com/c/go/+/494057
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
src/testing/benchmark.go
src/testing/testing.go
src/testing/testing_test.go