-
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
cmd/go, testing: TB.Failed does not report race failures #19851
Comments
Probably need to make t.Failed look at race.Errors(). |
I have a WIP CL. I think the fix is easy but writing a test requires a certain amount of cleverness I'm not sure I possess. I'll take another look later (but testing ideas on the CL are appreciated). |
CL https://golang.org/cl/39890 mentions this issue. |
Change https://golang.org/cl/54050 mentions this issue: |
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: I7bfdf281f90e045146c92444f1370d55c45221d4 Reviewed-on: https://go-review.googlesource.com/54050 Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com> Run-TryBot: Joe Tsai <thebrokentoaster@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
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>
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go version go1.8 darwin/amd64
What operating system and processor architecture are you using (
go env
)?What did you do?
main_test.go
:What did you expect to see?
What did you see instead?
Note the presence of
main_test.go:9: subtest did not fail
. We're running into this issue in CockroachDB, where we have logging redirection taking place for the duration of the test; if the test is not observed to have failed at the end of the run, the logs are cleaned up. As the snippet above demonstrates, it's not currently possible for a test to observe its own race-related failure, so we end up losing our logs. The CockroachDB issue is cockroachdb/cockroach#14563.Related to #15972.
cc @dvyukov @rsc
The text was updated successfully, but these errors were encountered: