Change-Id: Ic3464e95ad8901df5477d7717760b8c6d08ce97b
Reviewed-on: https://go-review.googlesource.com/c/go/+/426078
Run-TryBot: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Bryan Mills <bcmills@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
"path/filepath"
"reflect"
"runtime"
- "sync/atomic"
"time"
)
// the original panic should still be
// clear.
if f.Failed() {
- atomic.AddUint32(&numFailed, 1)
+ numFailed.Add(1)
}
err := recover()
if err == nil {
cpuList []int
testlogFile *os.File
- numFailed uint32 // number of test failures
+ numFailed atomic.Uint32 // number of test failures
)
type chattyPrinter struct {
// a signal saying that the test is done.
defer func() {
if t.Failed() {
- atomic.AddUint32(&numFailed, 1)
+ numFailed.Add(1)
}
if t.raceErrors+race.Errors() > 0 {
}
func shouldFailFast() bool {
- return *failFast && atomic.LoadUint32(&numFailed) > 0
+ return *failFast && numFailed.Load() > 0
}