From 1163127def254969c92c20ce0e535690f3b1de4c Mon Sep 17 00:00:00 2001 From: Dmitriy Vyukov Date: Mon, 24 Feb 2014 20:32:28 +0400 Subject: [PATCH] testing: diagnose a potential misuse of RunParallel LGTM=bradfitz R=golang-codereviews, bradfitz CC=golang-codereviews https://golang.org/cl/68030043 --- src/pkg/testing/benchmark.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/pkg/testing/benchmark.go b/src/pkg/testing/benchmark.go index e6f3c6d790..06b5b603e3 100644 --- a/src/pkg/testing/benchmark.go +++ b/src/pkg/testing/benchmark.go @@ -417,6 +417,9 @@ func (b *B) RunParallel(body func(*PB)) { }() } wg.Wait() + if n == 0 { + b.Fatal("RunParallel body did not not call PB.Next") + } } // SetParallelism sets the number of goroutines used by RunParallel to p*GOMAXPROCS. -- 2.48.1