PYTHON-5078 Convert test.test_discovery_and_monitoring to async
Still seeing some failures on Windows.
Looks like one more newly added flaky test on the latest patch:
[2025/02/28 14:01:50.193] _____ TestUnifiedHelloTimeout.test_Driver_extends_timeout_while_streaming _____
[2025/02/28 14:01:50.193] self = <test.asynchronous.test_discovery_and_monitoring.TestUnifiedHelloTimeout testMethod=test_Driver_extends_timeout_while_streaming>
[2025/02/28 14:01:50.193] async def test_case(self):
[2025/02/28 14:01:50.193] > await self.run_scenario(spec)
[2025/02/28 14:01:50.193] test\asynchronous\unified_format.py:1474:
[2025/02/28 14:01:50.193] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
[2025/02/28 14:01:50.193] test\asynchronous\unified_format.py:1416: in run_scenario
[2025/02/28 14:01:50.193] await self._run_scenario(spec, uri)
[2025/02/28 14:01:50.193] test\asynchronous\unified_format.py:1451: in _run_scenario
[2025/02/28 14:01:50.193] await self.run_operations(spec["operations"])
[2025/02/28 14:01:50.193] test\asynchronous\unified_format.py:1251: in run_operations
[2025/02/28 14:01:50.193] await self.run_special_operation(op)
[2025/02/28 14:01:50.193] test\asynchronous\unified_format.py:1246: in run_special_operation
[2025/02/28 14:01:50.193] method(spec["arguments"])
[2025/02/28 14:01:50.193] test\asynchronous\unified_format.py:1134: in _testOperation_assertEventCount
[2025/02/28 14:01:50.193] self.assertEqual(self._event_count(client, event), count, f"expected {count} not {event!r}")
[2025/02/28 14:01:50.193] E AssertionError: 1 != 0 : expected 0 not {'serverDescriptionChangedEvent': {'newDescription': {'type': 'Unknown'}}}
https://spruce.mongodb.com/task/mongo_python_driver_test_win64_python3.9_test_latest_sharded_cluster_auth_ssl_async_patch_c9a85ad321f98caf314fc9da7a367e94d661abac_67c229ce475953000739759c_25_02_28_21_25_35/logs?execution=0&sortBy=STATUS&sortDir=ASC
How should we deal with this one?
Looks like one more newly added flaky test on the latest patch:
[2025/02/28 14:01:50.193] _____ TestUnifiedHelloTimeout.test_Driver_extends_timeout_while_streaming _____ [2025/02/28 14:01:50.193] self = <test.asynchronous.test_discovery_and_monitoring.TestUnifiedHelloTimeout testMethod=test_Driver_extends_timeout_while_streaming> [2025/02/28 14:01:50.193] async def test_case(self): [2025/02/28 14:01:50.193] > await self.run_scenario(spec) [2025/02/28 14:01:50.193] test\asynchronous\unified_format.py:1474: [2025/02/28 14:01:50.193] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ [2025/02/28 14:01:50.193] test\asynchronous\unified_format.py:1416: in run_scenario [2025/02/28 14:01:50.193] await self._run_scenario(spec, uri) [2025/02/28 14:01:50.193] test\asynchronous\unified_format.py:1451: in _run_scenario [2025/02/28 14:01:50.193] await self.run_operations(spec["operations"]) [2025/02/28 14:01:50.193] test\asynchronous\unified_format.py:1251: in run_operations [2025/02/28 14:01:50.193] await self.run_special_operation(op) [2025/02/28 14:01:50.193] test\asynchronous\unified_format.py:1246: in run_special_operation [2025/02/28 14:01:50.193] method(spec["arguments"]) [2025/02/28 14:01:50.193] test\asynchronous\unified_format.py:1134: in _testOperation_assertEventCount [2025/02/28 14:01:50.193] self.assertEqual(self._event_count(client, event), count, f"expected {count} not {event!r}") [2025/02/28 14:01:50.193] E AssertionError: 1 != 0 : expected 0 not {'serverDescriptionChangedEvent': {'newDescription': {'type': 'Unknown'}}}https://spruce.mongodb.com/task/mongo_python_driver_test_win64_python3.9_test_latest_sharded_cluster_auth_ssl_async_patch_c9a85ad321f98caf314fc9da7a367e94d661abac_67c229ce475953000739759c_25_02_28_21_25_35/logs?execution=0&sortBy=STATUS&sortDir=ASC
How should we deal with this one?
I'm down to try de-bugging. But there's a part of me that feels like it'll be a similar bug to the other flakey tests? So we can make a ticket for this tests and link it to the other one? Thoughts?
Sounds good to me.