Fixes the build from https://golang.org/cl/4117 (sync: simplify WaitGroup)
Change-Id: Icc2a7ba8acea26fd187d52cf1901bfebf8573f93
Reviewed-on: https://go-review.googlesource.com/11591
Reviewed-by: Austin Clements <austin@google.com>
// Export for testing.
var Runtime_Semacquire = runtime_Semacquire
var Runtime_Semrelease = runtime_Semrelease
+
+const RaceEnabled = raceenabled
}
}
+func knownRacy(t *testing.T) {
+ if RaceEnabled {
+ t.Skip("skipping known-racy test under the race detector")
+ }
+}
+
func TestWaitGroupMisuse(t *testing.T) {
defer func() {
err := recover()
}
func TestWaitGroupMisuse2(t *testing.T) {
+ knownRacy(t)
if runtime.NumCPU() <= 2 {
t.Skip("NumCPU<=2, skipping: this test requires parallelism")
}
}
func TestWaitGroupMisuse3(t *testing.T) {
+ knownRacy(t)
if runtime.NumCPU() <= 1 {
t.Skip("NumCPU==1, skipping: this test requires parallelism")
}