You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've taken a look I think I understand whats going on here, but I am not sure of the right way to go about fixing it. One side of the race condition is explicitly not locking, according to a comment above it.
This appears to be handled the same way in the t.Fail() path.
Any ideas or hints on the right way to solve this would be welcomed. I am happy to try and implement it if you can point me in the right direction, or to a person who is more likely to know the best way to solve this.
I don't think there is anything wrong with https://golang.org/cl/127596 . The testing package arranges for the race detector to report an error if there is an unsynchronized goroutine. CL 127596 introduces a new way for the race detector to notice an unsynchronized goroutine. Previously the race detector would notice an unsynchronized goroutine that calls t.Fail (or t.Error, etc.). Now the race detector will additionally notice an unsynchronized goroutine that calls t.Log. So I think we just need to fix this in the os/signal package.
Activity
bradfitz commentedon Oct 13, 2018
@wselwood, could you look into this?
emilyselwood commentedon Oct 13, 2018
I'll take a look.
emilyselwood commentedon Oct 17, 2018
Hi @bradfitz
I've taken a look I think I understand whats going on here, but I am not sure of the right way to go about fixing it. One side of the race condition is explicitly not locking, according to a comment above it.
This appears to be handled the same way in the t.Fail() path.
Any ideas or hints on the right way to solve this would be welcomed. I am happy to try and implement it if you can point me in the right direction, or to a person who is more likely to know the best way to solve this.
bradfitz commentedon Oct 17, 2018
I didn't follow the original CL. Maybe @ianlancetaylor or @mpvl have that code in their head at the moment.
ianlancetaylor commentedon Oct 17, 2018
I don't think there is anything wrong with https://golang.org/cl/127596 . The testing package arranges for the race detector to report an error if there is an unsynchronized goroutine. CL 127596 introduces a new way for the race detector to notice an unsynchronized goroutine. Previously the race detector would notice an unsynchronized goroutine that calls
t.Fail(ort.Error, etc.). Now the race detector will additionally notice an unsynchronized goroutine that callst.Log. So I think we just need to fix this in the os/signal package.gopherbot commentedon Oct 17, 2018
Change https://golang.org/cl/142889 mentions this issue:
os/signal: wait for goroutine in TestTerminalSignalemilyselwood commentedon Oct 18, 2018
Thanks @ianlancetaylor