From 37f64dc0fb67bb2544ce4aca8943d755fcfd27bc Mon Sep 17 00:00:00 2001 From: Noah Stapp Date: Thu, 7 May 2026 16:20:35 -0400 Subject: [PATCH] PYTHON-5631 - test_direct_client_maintains_pool_to_arbiter waits instead of asserting --- test/asynchronous/test_client.py | 2 +- test/test_client.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/asynchronous/test_client.py b/test/asynchronous/test_client.py index ca150ca6d..9023112b5 100644 --- a/test/asynchronous/test_client.py +++ b/test/asynchronous/test_client.py @@ -2715,7 +2715,7 @@ class TestClientPool(AsyncMockClientTest): await listener.async_wait_for_event(monitoring.ConnectionReadyEvent, 1) self.assertEqual(listener.event_count(monitoring.ConnectionCreatedEvent), 1) arbiter = c._topology.get_server_by_address(("c", 3)) - self.assertEqual(len(arbiter.pool.conns), 1) + await async_wait_until(lambda: len(arbiter.pool.conns) == 1, "create 1 pooled connection") # Arbiter pool is marked ready. self.assertEqual(listener.event_count(monitoring.PoolReadyEvent), 1) diff --git a/test/test_client.py b/test/test_client.py index 75d585fda..fb400b698 100644 --- a/test/test_client.py +++ b/test/test_client.py @@ -2670,7 +2670,7 @@ class TestClientPool(MockClientTest): listener.wait_for_event(monitoring.ConnectionReadyEvent, 1) self.assertEqual(listener.event_count(monitoring.ConnectionCreatedEvent), 1) arbiter = c._topology.get_server_by_address(("c", 3)) - self.assertEqual(len(arbiter.pool.conns), 1) + wait_until(lambda: len(arbiter.pool.conns) == 1, "create 1 pooled connection") # Arbiter pool is marked ready. self.assertEqual(listener.event_count(monitoring.PoolReadyEvent), 1)