1
0
mirror of https://github.com/golang/go synced 2024-11-23 16:50:06 -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:
Dmitriy Vyukov 2014-02-24 21:08:37 +04:00
parent ea87501750
commit 5b6aaba1ce

View File

@ -417,8 +417,8 @@ func (b *B) RunParallel(body func(*PB)) {
}() }()
} }
wg.Wait() wg.Wait()
if n == 0 { if n <= uint64(b.N) && !b.Failed() {
b.Fatal("RunParallel body did not not call PB.Next") b.Fatal("RunParallel: body exited without pb.Next() == false")
} }
} }