PYTHON-4789 Migrate test_retryable_reads.py to async#1877
Merged
sleepyStick merged 7 commits intomongodb:masterfrom Oct 1, 2024
Merged
PYTHON-4789 Migrate test_retryable_reads.py to async#1877sleepyStick merged 7 commits intomongodb:masterfrom
sleepyStick merged 7 commits intomongodb:masterfrom
Conversation
NoahStapp
requested changes
Sep 27, 2024
| client = await self.async_rs_or_single_client( | ||
| maxPoolSize=1, event_listeners=[cmap_listener, cmd_listener] | ||
| ) | ||
| self.addAsyncCleanup(client.close) |
Contributor
There was a problem hiding this comment.
We don't need to add explicit cleanup when using the helper methods to create clients, they do the cleanup for us.
| for mongos in async_client_context.mongos_seeds().split(","): | ||
| client = await self.async_rs_or_single_client(mongos) | ||
| await async_set_fail_point(client, fail_command) | ||
| self.addAsyncCleanup(client.close) |
NoahStapp
requested changes
Sep 30, 2024
| _IS_SYNC = False | ||
|
|
||
| # Location of JSON test specifications. | ||
| _TEST_PATH = os.path.join(os.path.dirname(os.path.realpath(__file__)), "retryable_reads", "legacy") |
Contributor
There was a problem hiding this comment.
This path will be for test/asynchronous/retryable_reads... which doesn't exist, it needs to look in the top-level test directory and not the test/asynchronous one.
Contributor
Author
There was a problem hiding this comment.
good catch! I fixed it (I think), but uh why is _TEST_PATH not used anywhere in the file? (like as far as I can tell, its just defined but never used??)
Contributor
There was a problem hiding this comment.
Good point! I actually think our retryable read tests are fully converted to unified, so we can remove _TEST_PATH here entirely.
afb7eaa to
0b7f216
Compare
0b7f216 to
00d231e
Compare
00d231e to
61591fd
Compare
NoahStapp
approved these changes
Oct 1, 2024
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Note: I made
test_pool_paused_error_is_retryablerequire sync because it uses threads, we can consider changing it to tasks too though!