-
Notifications
You must be signed in to change notification settings - Fork 918
Remove the unused and dangerous ShareClient mtest option. #2225
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
Remove the unused and dangerous ShareClient mtest option. #2225
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 removes the unused and potentially problematic ShareClient
mtest option. The feature allowed sharing a single mongo.Client
across all subtests, but this interfered with built-in event and command capture capabilities, potentially causing flaky or incorrectly passing tests.
- Removed the
ShareClient()
option method from the Options API - Removed the
shareClient
field and all related logic from the test runner - Simplified client lifecycle management by ensuring each subtest always gets its own client
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
File | Description |
---|---|
internal/integration/mtest/options.go | Removed the ShareClient() method that configured client sharing behavior |
internal/integration/mtest/mongotest.go | Removed shareClient field, eliminated client sharing logic in test setup and teardown, and simplified client creation flow |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
API Change ReportNo changes found! |
🧪 Performance ResultsCommit SHA: 8e0de1aThe following benchmark tests for version 68f17d3752bc1f0007acc5f4 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. |
Summary
Remove the unused
ShareClient
mtest option.Background & Motivation
If
ShareClient=true
is set, mtest will share the samemongo.Client
across all subtests. There are a number of mtest capabilities, like built-in event capture and command capture that do not work correctly if a shared client is used across multiple subtests, which could lead to difficult to diagnose flaky tests or tests that succeed when they should not. That feature is completely unused, so remove it.