-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Closed
Labels
Milestone
Description
Maybe I missed this behavior until now, still it seems a bug. Opposed to Go 1.8.3 (#21338 (comment)), running a racey test suite with Go 1.9rc2 results in all tests after the racey one being marked as failed:
package main
import (
"testing"
)
func TestPreRace(t *testing.T) {
// Nothing to do, must succeed
}
func TestRace(t *testing.T) {
// Blow it up
var n int
wait := make(chan struct{})
go func() {
defer close(wait)
n++
}()
n++
<-wait
}
func TestPostRace(t *testing.T) {
// Nothing to do, must succeed
}$ go test -v --race
=== RUN TestPreRace
--- PASS: TestPreRace (0.00s)
=== RUN TestRace
==================
WARNING: DATA RACE
[...]
==================
--- FAIL: TestRace (1.00s)
testing.go:700: race detected during execution of test
=== RUN TestPostRace
--- FAIL: TestPostRace (0.00s)
Note, TestPostRace is marked as failed.
Reactions are currently unavailable