Skip to content
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

PYTHON-4789 Migrate test_retryable_reads.py to async #1877

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

sleepyStick
Copy link
Contributor

@sleepyStick sleepyStick commented Sep 27, 2024

Note: I made test_pool_paused_error_is_retryable require sync because it uses threads, we can consider changing it to tasks too though!

@sleepyStick sleepyStick changed the title Migrate test_retryable_reads.py to async PYTHON-4789 Migrate test_retryable_reads.py to async Sep 27, 2024
@sleepyStick sleepyStick marked this pull request as ready for review September 27, 2024 16:44
client = await self.async_rs_or_single_client(
maxPoolSize=1, event_listeners=[cmap_listener, cmd_listener]
)
self.addAsyncCleanup(client.close)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants