-
Notifications
You must be signed in to change notification settings - Fork 918
Use require instead of assert for error checking in GridFS tests. #2167
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
Use require instead of assert for error checking in GridFS tests. #2167
Conversation
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.
Pull Request Overview
This PR replaces assert.Nil
calls with require.NoError
when checking for errors in the GridFS integration tests to ensure tests fail immediately on unexpected errors rather than continuing execution and potentially panicking on nil pointer dereferences.
- Changes error checking assertions from
assert.Nil
torequire.NoError
throughout GridFS tests - Adds import for the
require
package - Updates one assertion from
assert.NotNil
toassert.Error
for consistency with error checking patterns
API Change ReportNo changes found! |
🧪 Performance ResultsCommit SHA: 085f31fThe following benchmark tests for version 689b8dfbeee2bf00077eb131 had statistically significant changes (i.e., |z-score| > 1.96):
For a comprehensive view of all microbenchmark results for this PR's commit, please check out the Evergreen perf task for this patch. |
Co-authored-by: Copilot <[email protected]>
Summary
Use
require.NoError
instead ofassert.Nil
when checking errors in the GridFS integration tests to prevent the test from continuing after an unexpected error.Background & Motivation
The GridFS tests in the "internal/integration" package will continue after an error and possibly reference uninitialized values, leading to a panic like: