PYTHON-5101 Convert test.test_server_selection_in_window to async#2119
PYTHON-5101 Convert test.test_server_selection_in_window to async#2119sleepyStick merged 20 commits intomongodb:masterfrom
Conversation
|
There is an existing patch(es) for this commit SHA: Please note that the status that is posted is not in the context of this PR but rather the (latest) existing patch and that may affect some tests that may depend on the particular PR. If your tests do not rely on any PR-specific values (like base or head branch name) then your tests will report the same status. If you would like a patch to run in the context of this PR and abort the other(s), comment 'evergreen retry'. |
|
|
||
| class TestAllScenarios(unittest.IsolatedAsyncioTestCase): | ||
| def run_scenario(self, scenario_def): | ||
| topology = create_topology(scenario_def) |
There was a problem hiding this comment.
We'll need to make an async_create_topology here to create a pymongo.asynchronous.topology.Topology instance. Our current create_topology method creates a synchronous one.
There was a problem hiding this comment.
ahh i see! I ended up making an async version of the utils_selection_tests.py file? thoughts?
There was a problem hiding this comment.
To minimize code duplication, only classes/functions that differ between async and sync should be in synchro'd files. I'd make a separate utils_selection_tests_shared.py file for all of the code that's the same between both and keep only the code that differs in utils_selection_tests.py.
There was a problem hiding this comment.
sounds good, done!
| "appName": "loadBalancingTest", | ||
| }, | ||
| } | ||
| with self.fail_point(delay_finds): |
There was a problem hiding this comment.
| with self.fail_point(delay_finds): | |
| async with self.fail_point(delay_finds): |
Co-authored-by: Noah Stapp <noah@noahstapp.com>
NoahStapp
left a comment
There was a problem hiding this comment.
The same test_encryption issue is present here too, we need to update test_encryption.create_tests to not use an async method.
Yeahhhh i see that now, okay I fixed it here, I'll assume this PR will be merged first and then pull it from master into the other one |
Co-authored-by: Noah Stapp <noah@noahstapp.com>
Co-authored-by: Noah Stapp <noah@noahstapp.com>
Co-authored-by: Noah Stapp <noah@noahstapp.com>
Co-authored-by: Noah Stapp <noah@noahstapp.com>
Co-authored-by: Noah Stapp <noah@noahstapp.com>
No description provided.