Skip to content

PYTHON-5079 Convert test.test_dns to async #2096

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 7 commits into from
Jan 31, 2025

Conversation

sleepyStick
Copy link
Contributor

No description provided.

@sleepyStick sleepyStick marked this pull request as ready for review January 30, 2025 19:56
@sleepyStick sleepyStick requested a review from NoahStapp January 30, 2025 19:56
# tests.
copts["tlsAllowInvalidHostnames"] = True

client = AsyncPyMongoTestCase.unmanaged_simple_client(uri, **copts)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
client = AsyncPyMongoTestCase.unmanaged_simple_client(uri, **copts)
client = self.simple_client(uri, **copts)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

how do we decide when to use helper methods vs the unmanaged clients?

Copy link
Contributor

Choose a reason for hiding this comment

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

Generally you should always use helper methods unless we need a client somewhere entirely out of a unittest class context. Those situations should be very rare in our test suites.

await client.admin.command("ping")
# XXX: we should block until SRV poller runs at least once
# and re-run these assertions.
await 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.

This can be removed since our clients are closed automatically when using the helper methods.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, make sense :)

@sleepyStick sleepyStick requested a review from NoahStapp January 30, 2025 21:18
@sleepyStick sleepyStick merged commit c42f3d6 into mongodb:master Jan 31, 2025
44 of 46 checks passed
@sleepyStick sleepyStick deleted the PYTHON-5079 branch January 31, 2025 16:43
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