-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Recover general chunker panics #3625
Conversation
panic("panic for testing") | ||
} | ||
|
||
func TestChunkReader_UnderlyingReaderPanics_DoesNotPanic(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.
should the test verify that the error is returned through the channel?
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.
good question! my vote is "no," because imo the specific correct behavior is not obvious, beyond "shouldn't panic" - which is what the test checks right now.
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.
one question. otherwise looks good
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.
Thank you ❤️
Description:
We have recently seen panics when underlying readers panic (which can happen due to third-party library bugs). I'm not sure why the panics are new - it could be a case of bad luck, but there have also been recent changes to error handling. This is the smallest change that seems to fix a real problem but I'm not sure if it's the best global solution.
Checklist:
make test-community
)?make lint
this requires golangci-lint)?