- Notifications
You must be signed in to change notification settings - Fork928
fix: race panic intest/go/postgres
#1752
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
I think this change would reduce the probability of a race, but not completely eliminate it. In the current version of the code, the goroutine that generates the log message is reading Here's a minimal example that demonstrates the same issue. It succeeds on the playground, but fails if run with I think fixing this properly requires pushing the synchronization all the way to
|
I looked into doing something like that as my first option, but how would the test sink know when the test exits? |
Hmm, I guess maybe if the sink had its own |
Yeah, at first I was thinking we'd have to make |
Closing in favor ofcoder/slog#146 and#1759 |
Uh oh!
There was an error while loading.Please reload this page.
https://github.com/coder/coder/actions/runs/2359166491/attempts/1
The current race condition is caused by a call to
t.Log
at the same time a test is finishing. This PR changes the logger to be swapped out before tests exit, to avoid any logs that may race with a test finishing.