Skip to content

PYTHON-5092 - Convert test.test_pooling to async #2145

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 3 commits into from
Feb 13, 2025

Conversation

NoahStapp
Copy link
Contributor

No description provided.

await db.test.insert_many([{} for _ in range(10)])

async def asyncTearDown(self):
await self.c.close()
Copy link
Contributor

@sleepyStick sleepyStick Feb 12, 2025

Choose a reason for hiding this comment

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

is this self.c.close() needed? I thought async_rs_or_single_client() would close it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch! Removed.

@@ -15,18 +15,20 @@
"""Test built in connection-pooling with threads."""
from __future__ import annotations

import asyncio
Copy link
Member

Choose a reason for hiding this comment

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

I thought synchro.py was supposed to remove asyncio imports?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It doesn't remove asyncio imports. We still have some files that have _IS_SYNC branches that make use of asyncio.

import time
from test.helpers import ConcurrentRunner
Copy link
Member

Choose a reason for hiding this comment

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

please move this down next to the other test imports.

@NoahStapp NoahStapp merged commit 338b7dc into mongodb:master Feb 13, 2025
45 of 51 checks passed
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.

3 participants