mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
testing: fix racey access to t.failed
We need to grab the mutex before we can access it. Fixes #24438 Change-Id: Idd6130036691acec5bc5f8b40d6884f8db1d9d3c Reviewed-on: https://go-review.googlesource.com/101283 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
parent
0dcdbc772e
commit
eff1e68528
1 changed files with 1 additions and 1 deletions
|
|
@ -731,7 +731,7 @@ func tRunner(t *T, fn func(t *T)) {
|
||||||
// a call to runtime.Goexit, record the duration and send
|
// a call to runtime.Goexit, record the duration and send
|
||||||
// a signal saying that the test is done.
|
// a signal saying that the test is done.
|
||||||
defer func() {
|
defer func() {
|
||||||
if t.failed {
|
if t.Failed() {
|
||||||
atomic.AddUint32(&numFailed, 1)
|
atomic.AddUint32(&numFailed, 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue