-
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: Cleanup races with Logf and Errorf #40908
Comments
Looks like https://go-review.googlesource.com/c/go/+/232237 introduced this issue FWIW. |
@bcmills Indeed, thanks for pointing this out. I'll work on a fix. |
We also ran into this here: knative/serving#9153 when I switched from defer to t.Cleanup. |
Change https://golang.org/cl/250078 mentions this issue: |
@gopherbot, please backport to 1.15. This is a fairly subtle race condition, and the fix is small and contained. |
Backport issue(s) opened: #41034 (for 1.15). Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://golang.org/wiki/MinorReleases. |
Go 1.14.7 does not seem to be affected, so no backport to 1.14 is needed. |
Change https://golang.org/cl/250617 mentions this issue: |
Updates #40908 Fixes #41034 Change-Id: I25561a3f18e730a50e6fbf85aa7bd85bf1b73b6e Reviewed-on: https://go-review.googlesource.com/c/go/+/250078 Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com> Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> (cherry picked from commit 00a053b) Reviewed-on: https://go-review.googlesource.com/c/go/+/250617 Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com> Reviewed-by: Michał Łowicki <mlowicki@gmail.com>
The program in https://play.golang.org/p/rV-CkJivlXs fails under
go test -race
:I think this race should be fixed, because this usage seems reasonable to me: for example, calling
t.Logf
directly from theCleanup
callback does not race, and it seems very odd to allowt.Logf
before and after cleanup begins but not during.CC @rogpeppe @ianlancetaylor @bradfitz
The text was updated successfully, but these errors were encountered: