diff --git a/src/sync/runtime_sema_test.go b/src/sync/runtime_sema_test.go index 5b7dd3df3f0..a2382f46554 100644 --- a/src/sync/runtime_sema_test.go +++ b/src/sync/runtime_sema_test.go @@ -25,6 +25,9 @@ func BenchmarkSemaUncontended(b *testing.B) { } func benchmarkSema(b *testing.B, block, work bool) { + if b.N == 0 { + return + } sem := uint32(0) if block { done := make(chan bool)