Skip to content

Commit eff1e68

Browse files
nhooyrianlancetaylor
authored andcommitted
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 <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
1 parent 0dcdbc7 commit eff1e68

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/testing/testing.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -731,7 +731,7 @@ func tRunner(t *T, fn func(t *T)) {
731731
// a call to runtime.Goexit, record the duration and send
732732
// a signal saying that the test is done.
733733
defer func() {
734-
if t.failed {
734+
if t.Failed() {
735735
atomic.AddUint32(&numFailed, 1)
736736
}
737737

0 commit comments

Comments
 (0)