-
Notifications
You must be signed in to change notification settings - Fork 17.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
testing: tests after a data race are marked as failed (1.9rc2) #21338
Comments
Can you please check and see if this is a regression over 1.8?
…On Tue, Aug 8, 2017 at 6:26 PM, Péter Szilágyi ***@***.***> wrote:
Maybe I missed this behavior until now, still it seems a bug. 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)
FAIL
exit status 1
FAIL github.com/ethereum/go-ethereum/racetest 1.005s
Note, TestPostRace is marked as failed.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#21338>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAAcA2RTSJDilA_u6q_0QcoEEUmsqlQDks5sWBu5gaJpZM4OwZ5d>
.
|
Failing tests due to races is new in 1.9 – that it flags all following tests as failed might be a bug. |
@dominikh Tests always failed if a data race was detected. @davecheney Go 1.8.3 only marks the racey test failed, not the others.
|
This may be a regression /cc @ianlancetaylor @broady |
I also saw this recently and was puzzled, but I assumed it was somehow on purpose to highlight the data race. If it was on purpose, this should be documented in the release notes. Either way, something to do for 1.9. |
CC @cespare |
I'm testing a fix. |
Change https://golang.org/cl/54050 mentions this issue: |
Reopening for 1.9 backport. |
Change https://golang.org/cl/57151 mentions this issue: |
…failure The code was adding race.Errors to t.raceErrors before checking Failed, but Failed was using t.raceErrors+race.Errors. We don't want to change Failed, since that would affect tests themselves, so modify the harness to not unnecessarily change t.raceErrors. Updates #19851 Fixes #21338 Change-Id: I483f27c68c340928f1cbdef160abc0a5716efb5d Reviewed-on: https://go-review.googlesource.com/57151 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Fixed on 1.9 by fbf7e1f |
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:Note,
TestPostRace
is marked as failed.The text was updated successfully, but these errors were encountered: