File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2711,11 +2711,11 @@ async def test_direct_client_maintains_pool_to_arbiter(self):
27112711
27122712 await async_wait_until (lambda : len (c .nodes ) == 1 , "connect" )
27132713 self .assertEqual (await c .address , ("c" , 3 ))
2714- # Assert that we create 1 pooled connection.
2714+ # Wait for the pooled connection to be registered
27152715 await listener .async_wait_for_event (monitoring .ConnectionReadyEvent , 1 )
27162716 self .assertEqual (listener .event_count (monitoring .ConnectionCreatedEvent ), 1 )
27172717 arbiter = c ._topology .get_server_by_address (("c" , 3 ))
2718- self . assertEqual ( len (arbiter .pool .conns ), 1 )
2718+ await async_wait_until ( lambda : len (arbiter .pool .conns ) == 1 , "create 1 pooled connection" )
27192719 # Arbiter pool is marked ready.
27202720 self .assertEqual (listener .event_count (monitoring .PoolReadyEvent ), 1 )
27212721
Original file line number Diff line number Diff line change @@ -2666,11 +2666,11 @@ def test_direct_client_maintains_pool_to_arbiter(self):
26662666
26672667 wait_until (lambda : len (c .nodes ) == 1 , "connect" )
26682668 self .assertEqual (c .address , ("c" , 3 ))
2669- # Assert that we create 1 pooled connection.
2669+ # Wait for the pooled connection to be registered
26702670 listener .wait_for_event (monitoring .ConnectionReadyEvent , 1 )
26712671 self .assertEqual (listener .event_count (monitoring .ConnectionCreatedEvent ), 1 )
26722672 arbiter = c ._topology .get_server_by_address (("c" , 3 ))
2673- self . assertEqual ( len (arbiter .pool .conns ), 1 )
2673+ wait_until ( lambda : len (arbiter .pool .conns ) == 1 , "create 1 pooled connection" )
26742674 # Arbiter pool is marked ready.
26752675 self .assertEqual (listener .event_count (monitoring .PoolReadyEvent ), 1 )
26762676
You can’t perform that action at this time.
0 commit comments