Skip to content

PYTHON-4733 Migrate test_auth.py to async #1838

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 9 commits into from
Sep 9, 2024

Conversation

sleepyStick
Copy link
Contributor

No description provided.

@sleepyStick
Copy link
Contributor Author

so...i'm honestly not sure what I did to this commit history HAHA I was just trying to rebase my branch..

@sleepyStick sleepyStick marked this pull request as ready for review September 6, 2024 18:57
@NoahStapp
Copy link
Contributor

NoahStapp commented Sep 6, 2024

Can you undo the rebase and merge master into the un-rebased branch? There's changes already in master that show up in this PR.

@sleepyStick
Copy link
Contributor Author

I think I did it correctly?

self.success = True
else:

def _run_async():
Copy link
Member

Choose a reason for hiding this comment

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

Any threading test needs to be skipped for async because async client doesn't support multithreading.

@@ -204,6 +215,8 @@ def test_gssapi_simple(self):

@ignore_deprecations
def test_gssapi_threaded(self):
if not _IS_SYNC:
Copy link
Contributor

Choose a reason for hiding this comment

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

Use @async_client_context.require_sync as a decorator for sync-only tests instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

cool cool, didn't know about this! thanks!

@@ -579,6 +594,8 @@ def test_cache(self):
self.assertIsInstance(iterations, int)

def test_scram_threaded(self):
if not _IS_SYNC:
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.

@@ -74,8 +77,16 @@ def __init__(self, collection):
self.success = False

def run(self):
assert self.collection.find_one({"$where": delay(1)}) is not None
self.success = True
if _IS_SYNC:
Copy link
Contributor

Choose a reason for hiding this comment

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

Since the async client doesn't support multithreading, we don't need to have AutoAuthenticateThread support async.

Copy link
Contributor

@NoahStapp NoahStapp left a comment

Choose a reason for hiding this comment

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

Great work!

@sleepyStick sleepyStick merged commit ead3201 into mongodb:master Sep 9, 2024
34 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