diff --git a/test/asynchronous/test_discovery_and_monitoring.py b/test/asynchronous/test_discovery_and_monitoring.py index 6fc0e09a19..84382cf86f 100644 --- a/test/asynchronous/test_discovery_and_monitoring.py +++ b/test/asynchronous/test_discovery_and_monitoring.py @@ -360,8 +360,14 @@ class TestPoolManagement(AsyncIntegrationTest): async def test_pool_unpause(self): # This test implements the prose test "AsyncConnection Pool Management" listener = CMAPHeartbeatListener() + # Force polling: streaming's RTT monitor sends its own hello calls with the same + # appName, which can consume the failCommand's mode.times budget before the SDAM + # heartbeat monitor's hello does, so ServerHeartbeatFailedEvent never fires (PYTHON-6003). _ = await self.async_single_client( - appName="SDAMPoolManagementTest", heartbeatFrequencyMS=500, event_listeners=[listener] + appName="SDAMPoolManagementTest", + heartbeatFrequencyMS=500, + event_listeners=[listener], + serverMonitoringMode="poll", ) # Assert that AsyncConnectionPoolReadyEvent occurs after the first # ServerHeartbeatSucceededEvent. diff --git a/test/test_discovery_and_monitoring.py b/test/test_discovery_and_monitoring.py index 612d52afbf..7b36cc318a 100644 --- a/test/test_discovery_and_monitoring.py +++ b/test/test_discovery_and_monitoring.py @@ -360,8 +360,14 @@ class TestPoolManagement(IntegrationTest): def test_pool_unpause(self): # This test implements the prose test "Connection Pool Management" listener = CMAPHeartbeatListener() + # Force polling: streaming's RTT monitor sends its own hello calls with the same + # appName, which can consume the failCommand's mode.times budget before the SDAM + # heartbeat monitor's hello does, so ServerHeartbeatFailedEvent never fires (PYTHON-6003). _ = self.single_client( - appName="SDAMPoolManagementTest", heartbeatFrequencyMS=500, event_listeners=[listener] + appName="SDAMPoolManagementTest", + heartbeatFrequencyMS=500, + event_listeners=[listener], + serverMonitoringMode="poll", ) # Assert that ConnectionPoolReadyEvent occurs after the first # ServerHeartbeatSucceededEvent.