]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: disable parallel for tests under race detector.
authorDmitriy Vyukov <dvyukov@google.com>
Tue, 6 Nov 2012 08:09:40 +0000 (12:09 +0400)
committerDmitriy Vyukov <dvyukov@google.com>
Tue, 6 Nov 2012 08:09:40 +0000 (12:09 +0400)
The race detector does not understand ParFor synchronization, because it's implemented in C.
If run with -cpu=2 currently race detector says:
 WARNING: DATA RACE
 Read by goroutine 5:
  runtime_test.TestParForParallel()
      src/pkg/runtime/parfor_test.go:118 +0x2e0
  testing.tRunner()
      src/pkg/testing/testing.go:301 +0x8f
 Previous write by goroutine 6:
  runtime_test.funcĀ·024()
      src/pkg/runtime/parfor_test.go:111 +0x52

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6811082

src/pkg/runtime/parfor_test.go

index 0547db0209655a2899dd9c5c33daaeb477e0f44c..7644354ab36af3a85c7df34d44087560693a7023 100644 (file)
@@ -2,6 +2,9 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// The race detector does not understand ParFor synchronization.
+// +build !race
+
 package runtime_test
 
 import (