-
Notifications
You must be signed in to change notification settings - Fork 1.1k
PYTHON-5767 - Finalize client backpressure implementation for phase 1… #2742
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
Merged
Merged
Changes from 3 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
5541dd0
PYTHON-5767 - Finalize client backpressure implementation for phase 1…
NoahStapp a766335
Fix docstring
NoahStapp 581b63a
Update URI option tests
NoahStapp 2c56a12
Update prose tests
NoahStapp b607bb6
Linting
NoahStapp 4560d96
CP review
NoahStapp 5921853
CP review
NoahStapp bf616a2
Sharded clusters always have overload retargeting enabled
NoahStapp ade6624
IH review
NoahStapp 5716b6b
Update changelog
NoahStapp e051175
AC review
NoahStapp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -652,20 +652,37 @@ async def test_detected_environment_warning(self, mock_get_hosts): | |
| with self.assertWarns(UserWarning): | ||
| self.simple_client(multi_host) | ||
|
|
||
| async def test_adaptive_retries(self): | ||
| # Assert that adaptive retries are disabled by default. | ||
| async def test_max_adaptive_retries(self): | ||
| # Assert that max adaptive retries default to 2. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: "defaults to 2" |
||
| c = self.simple_client(connect=False) | ||
| self.assertFalse(c.options.adaptive_retries) | ||
| self.assertEqual(c.options.max_adaptive_retries, 2) | ||
|
|
||
| # Assert that adaptive retries can be enabled through connection or client options. | ||
|
NoahStapp marked this conversation as resolved.
Outdated
|
||
| c = self.simple_client(connect=False, adaptive_retries=True) | ||
| self.assertTrue(c.options.adaptive_retries) | ||
| c = self.simple_client(connect=False, max_adaptive_retries=10) | ||
| self.assertEqual(c.options.max_adaptive_retries, 10) | ||
|
|
||
| c = self.simple_client(connect=False, adaptiveRetries=True) | ||
| self.assertTrue(c.options.adaptive_retries) | ||
| c = self.simple_client(connect=False, maxAdaptiveRetries=10) | ||
| self.assertEqual(c.options.max_adaptive_retries, 10) | ||
|
NoahStapp marked this conversation as resolved.
Outdated
|
||
|
|
||
| c = self.simple_client(host="mongodb://localhost/?adaptiveretries=true", connect=False) | ||
| self.assertTrue(c.options.adaptive_retries) | ||
| c = self.simple_client(host="mongodb://localhost/?maxAdaptiveRetries=10", connect=False) | ||
| self.assertEqual(c.options.max_adaptive_retries, 10) | ||
|
|
||
| async def test_enable_overload_retargeting(self): | ||
| # Assert that overload retargeting defaults to false. | ||
| c = self.simple_client(connect=False) | ||
| self.assertFalse(c.options.enable_overload_retargeting) | ||
|
|
||
| # Assert that overload retargeting can be enabled through connection or client options. | ||
| c = self.simple_client(connect=False, enable_overload_retargeting=True) | ||
| self.assertTrue(c.options.enable_overload_retargeting) | ||
|
|
||
| c = self.simple_client(connect=False, enableOverloadRetargeting=True) | ||
| self.assertTrue(c.options.enable_overload_retargeting) | ||
|
|
||
| c = self.simple_client( | ||
| host="mongodb://localhost/?enableOverloadRetargeting=true", connect=False | ||
| ) | ||
| self.assertTrue(c.options.enable_overload_retargeting) | ||
|
|
||
|
|
||
| class TestClient(AsyncIntegrationTest): | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.