chore: fix race and panic#8795
Conversation
Signed-off-by: zirain <zirain2009@gmail.com>
✅ Deploy Preview for cerulean-figolla-1f9435 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report❌ Patch coverage is
❌ Your patch status has failed because the patch coverage (12.00%) is below the target coverage (60.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #8795 +/- ##
==========================================
- Coverage 73.67% 73.63% -0.04%
==========================================
Files 245 245
Lines 48846 48864 +18
==========================================
- Hits 35987 35982 -5
- Misses 10856 10878 +22
- Partials 2003 2004 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Most likely |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4f4e854602
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
Codex Review: Didn't find any major issues. Breezy! ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
| r.Logger, | ||
| message.Metadata{Runner: r.Name(), Message: message.InfraIRMessageName}, sub, | ||
| func(update message.Update[string, *ir.Infra], errChan chan error) { | ||
| // Check if context is done before logging to avoid writing to test output after test completes |
There was a problem hiding this comment.
None-blocking nit:
This might be simpler:
if ctx.Err() != nil {
return
}* fix race and panic Signed-off-by: zirain <zirain2009@gmail.com> * fix race Signed-off-by: zirain <zirain2009@gmail.com> --------- Signed-off-by: zirain <zirain2009@gmail.com> Co-authored-by: Rudrakh Panigrahi <rudrakh97@gmail.com> Signed-off-by: Jake Oliver <jake@truelayer.com>
The goroutine continues to process messages and log after the test completes. The logger writes to the test's output, causing a data race.