From: Dmitriy Vyukov Date: Mon, 24 Feb 2014 17:08:37 +0000 (+0400) Subject: testing: improve diagnosis of a potential misuse of RunParallel X-Git-Tag: go1.3beta1~601 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=5b6aaba1ce869b3744f5f44bf218ef521bbd7940;p=gostls13.git testing: improve diagnosis of a potential misuse of RunParallel LGTM=rsc R=rsc CC=golang-codereviews https://golang.org/cl/68230045 --- diff --git a/src/pkg/testing/benchmark.go b/src/pkg/testing/benchmark.go index 06b5b603e3..1fbf5c8615 100644 --- a/src/pkg/testing/benchmark.go +++ b/src/pkg/testing/benchmark.go @@ -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") } }