Skip to content

Commit 6b3672f

Browse files
authored
Fix flakey test_normal_closure_while_client_sends_msg test (#10932)
1 parent 545783b commit 6b3672f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/test_web_websocket_functional.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1297,13 +1297,13 @@ async def handler(request: web.Request) -> web.WebSocketResponse:
12971297
async def test_normal_closure_while_client_sends_msg(
12981298
aiohttp_client: AiohttpClient,
12991299
) -> None:
1300-
"""Test abnormal closure when the server closes and the client doesn't respond."""
1300+
"""Test normal closure when the server closes and the client responds properly."""
13011301
close_code: Optional[WSCloseCode] = None
13021302
got_close_code = asyncio.Event()
13031303

13041304
async def handler(request: web.Request) -> web.WebSocketResponse:
1305-
# Setting a short close timeout
1306-
ws = web.WebSocketResponse(timeout=0.2)
1305+
# Setting a longer close timeout to avoid race conditions
1306+
ws = web.WebSocketResponse(timeout=1.0)
13071307
await ws.prepare(request)
13081308
await ws.close()
13091309

0 commit comments

Comments
 (0)