@@ -27,18 +27,6 @@ async def _find_connection_id(self, client, group_name, user_id):
2727 await asyncio .sleep (1 )
2828 return None
2929
30- async def _wait_for_server_cleanup (self , delay_seconds = 2 ):
31- """
32- Wait for server-side cleanup after closing a connection.
33-
34- The server needs time to process the disconnection before accepting new connections.
35- This is a pragmatic wait since we don't have a direct signal for when cleanup completes.
36-
37- Args:
38- delay_seconds: Time to wait in seconds (default 2 seconds for server cleanup)
39- """
40- await asyncio .sleep (delay_seconds )
41-
4230 async def _wait_for_connection_removed (self , client , connection_id ):
4331 for _ in range (30 ):
4432 if not await client .connection_exists (connection_id = connection_id ):
@@ -214,7 +202,7 @@ async def test_live_api_coverage_all_apis_and_parameters_async(
214202
215203 # close_group_connections (connection auto-joins group_1 via token)
216204 await ws .close ()
217- await self ._wait_for_server_cleanup ( )
205+ await self ._wait_for_connection_removed ( client , connection_id )
218206 ws = await ws_connect (access_token ["url" ], open_timeout = 30 )
219207 conn = await self ._find_connection_id (client , group_1 , user_id )
220208 assert conn is not None
@@ -223,7 +211,6 @@ async def test_live_api_coverage_all_apis_and_parameters_async(
223211 assert not await client .connection_exists (connection_id = conn )
224212
225213 # close_user_connections
226- await self ._wait_for_server_cleanup ()
227214 ws = await ws_connect (access_token ["url" ], open_timeout = 30 )
228215 conn = await self ._find_connection_id (client , group_1 , user_id )
229216 assert conn is not None
@@ -232,7 +219,6 @@ async def test_live_api_coverage_all_apis_and_parameters_async(
232219 assert not await client .connection_exists (connection_id = conn )
233220
234221 # close_connection
235- await self ._wait_for_server_cleanup ()
236222 ws = await ws_connect (access_token ["url" ], open_timeout = 30 )
237223 conn = await self ._find_connection_id (client , group_1 , user_id )
238224 assert conn is not None
@@ -241,7 +227,6 @@ async def test_live_api_coverage_all_apis_and_parameters_async(
241227 assert not await client .connection_exists (connection_id = conn )
242228
243229 # close_all_connections
244- await self ._wait_for_server_cleanup ()
245230 ws = await ws_connect (access_token ["url" ], open_timeout = 30 )
246231 conn = await self ._find_connection_id (client , group_1 , user_id )
247232 assert conn is not None
0 commit comments