mirror of
https://github.com/golang/go
synced 2024-11-23 14:00:03 -07:00
testing: improve diagnosis of a potential misuse of RunParallel
LGTM=rsc R=rsc CC=golang-codereviews https://golang.org/cl/68230045
This commit is contained in:
parent
ea87501750
commit
5b6aaba1ce
@ -417,8 +417,8 @@ func (b *B) RunParallel(body func(*PB)) {
|
||||
}()
|
||||
}
|
||||
wg.Wait()
|
||||
if n == 0 {
|
||||
b.Fatal("RunParallel body did not not call PB.Next")
|
||||
if n <= uint64(b.N) && !b.Failed() {
|
||||
b.Fatal("RunParallel: body exited without pb.Next() == false")
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user