mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
testing: don't fail all tests after racy test failure
The code was adding race.Errors to t.raceErrors before checking Failed, but Failed was using t.raceErrors+race.Errors. We don't want to change Failed, since that would affect tests themselves, so modify the harness to not unnecessarily change t.raceErrors. Updates #19851 Fixes #21338 Change-Id: I7bfdf281f90e045146c92444f1370d55c45221d4 Reviewed-on: https://go-review.googlesource.com/54050 Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com> Run-TryBot: Joe Tsai <thebrokentoaster@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
a14a8a3eb9
commit
a1371756c3
2 changed files with 22 additions and 2 deletions
|
|
@ -697,8 +697,7 @@ func tRunner(t *T, fn func(t *T)) {
|
|||
// a call to runtime.Goexit, record the duration and send
|
||||
// a signal saying that the test is done.
|
||||
defer func() {
|
||||
t.raceErrors += race.Errors()
|
||||
if t.raceErrors > 0 {
|
||||
if t.raceErrors+race.Errors() > 0 {
|
||||
t.Errorf("race detected during execution of test")
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue