diff options
| author | Anmol Sethi <me+git@anmol.io> | 2018-03-18 02:36:40 -0400 |
|---|---|---|
| committer | Ian Lance Taylor <iant@golang.org> | 2018-05-02 17:51:26 +0000 |
| commit | eff1e68528fc9052a7ff1ac7afe222696f85db8c (patch) | |
| tree | 13f028e5dccf0c118fcd0d5b7f2f5cc99f9e2227 /src/testing/testing.go | |
| parent | 0dcdbc772e62bf76b4468c288372b255dd18f4d8 (diff) | |
| download | go-eff1e68528fc9052a7ff1ac7afe222696f85db8c.tar.xz | |
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>
Diffstat (limited to 'src/testing/testing.go')
| -rw-r--r-- | src/testing/testing.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/testing/testing.go b/src/testing/testing.go index 429e03676c..573ef05fdc 100644 --- a/src/testing/testing.go +++ b/src/testing/testing.go @@ -731,7 +731,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() { - if t.failed { + if t.Failed() { atomic.AddUint32(&numFailed, 1) } |
