Skip to content

Commit 11aaa23

Browse files
[PR #10932/6b3672f0 backport][3.12] Fix flakey test_normal_closure_while_client_sends_msg test (#10935)
Co-authored-by: J. Nick Koston <[email protected]>
1 parent 0c16102 commit 11aaa23

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
@@ -1246,13 +1246,13 @@ async def handler(request: web.Request) -> web.WebSocketResponse:
12461246
async def test_normal_closure_while_client_sends_msg(
12471247
aiohttp_client: AiohttpClient,
12481248
) -> None:
1249-
"""Test abnormal closure when the server closes and the client doesn't respond."""
1249+
"""Test normal closure when the server closes and the client responds properly."""
12501250
close_code: Optional[WSCloseCode] = None
12511251
got_close_code = asyncio.Event()
12521252

12531253
async def handler(request: web.Request) -> web.WebSocketResponse:
1254-
# Setting a short close timeout
1255-
ws = web.WebSocketResponse(timeout=0.2)
1254+
# Setting a longer close timeout to avoid race conditions
1255+
ws = web.WebSocketResponse(timeout=1.0)
12561256
await ws.prepare(request)
12571257
await ws.close()
12581258

0 commit comments

Comments
 (0)