Skip to content

PYTHON-5356 - Init unified test client SDAM for all unified tests #2325

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 4 commits into from
May 8, 2025

Conversation

NoahStapp
Copy link
Contributor

@NoahStapp NoahStapp commented Apr 30, 2025

Explicitly connect clients for unified CSOT tests before the test begins to minimize flakiness caused by SDAM creation and startup.

Patch build with everything run: https://spruce.mongodb.com/version/6812632b5456710007edc380/tasks?sorts=STATUS%3AASC%3BBASE_STATUS%3ADESC

@NoahStapp NoahStapp requested a review from ShaneHarvey April 30, 2025 18:31
@@ -303,6 +303,8 @@ async def _create_entity(self, entity_spec, uri=None):
if uri:
kwargs["h"] = uri
client = await self.test.async_rs_or_single_client(**kwargs)
if init_client:
await client.aconnect()
Copy link
Member

Choose a reason for hiding this comment

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

We can remove init_client and always call aconnect() here, since aconnect() doesn't run any commands it's always safe to start SDAM tasks. If we added an explicit client.admin.command() then we would need the init_client flag.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do we actually want to call client.admin.command() instead? That would ensure we actually connect with a non-SDAM connection before the test.

Copy link
Member

Choose a reason for hiding this comment

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

I suspect that will cause problems with event monitoring. We plan to add "ping" explicitly to the unified tests themselves to fix that.

@NoahStapp NoahStapp requested a review from ShaneHarvey May 8, 2025 18:45
@NoahStapp NoahStapp changed the title PYTHON-5356 - Init unified test clients for CSOT tests PYTHON-5356 - Init unified test client SDAM for all unified tests May 8, 2025
@NoahStapp NoahStapp merged commit 98b030a into mongodb:master May 8, 2025
59 of 61 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.

2 participants