-
Notifications
You must be signed in to change notification settings - Fork 674
otellogr: Fix nil context panic #6527
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
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6527 +/- ##
=======================================
- Coverage 68.7% 68.7% -0.1%
=======================================
Files 200 200
Lines 16872 16873 +1
=======================================
- Hits 11604 11602 -2
- Misses 4925 4927 +2
- Partials 343 344 +1
|
Co-authored-by: Damien Mathieu <[email protected]>
# Conflicts: # CHANGELOG.md
- Remove `ctx` field and related context handling from `LogSink` struct - Simplify `Enabled` method to use `context.Background()` directly - Remove `WithContext` method and associated tests - Clean up test cases related to context handling
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure a consensus has been reached in #6509.
I think this is the proper fix and we probably do not need anything more than this. |
…est struct for clarity
Ready for approval. |
@@ -352,6 +352,40 @@ func TestLogSink(t *testing.T) { | |||
} | |||
} | |||
|
|||
// fix https://github.com/open-telemetry/opentelemetry-go-contrib/issues/6509 | |||
func TestLogSinkCtxInInfo(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't we add test cases to TestLogSink
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Upon checking, the structure of TestLogSink
is currently not suitable for my testing scenario. If adjustments are needed, more changes might be required.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. Approving. I can look and try refactoring it tomorrow.
@scorpionknifes, PTAL as a codeowner |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, LGTM (not a go approver)
@@ -352,6 +352,40 @@ func TestLogSink(t *testing.T) { | |||
} | |||
} | |||
|
|||
// fix https://github.com/open-telemetry/opentelemetry-go-contrib/issues/6509 | |||
func TestLogSinkCtxInInfo(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. Approving. I can look and try refactoring it tomorrow.
Fixes #6509