Commit 5b6aaba1 authored by Dmitriy Vyukov's avatar Dmitriy Vyukov

testing: improve diagnosis of a potential misuse of RunParallel

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/68230045
parent ea875017
......@@ -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")
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment