Skip to content

Fix flakey test_normal_closure_while_client_sends_msg test #10932

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 22, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions tests/test_web_websocket_functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -1297,13 +1297,13 @@ async def handler(request: web.Request) -> web.WebSocketResponse:
async def test_normal_closure_while_client_sends_msg(
aiohttp_client: AiohttpClient,
) -> None:
"""Test abnormal closure when the server closes and the client doesn't respond."""
"""Test normal closure when the server closes and the client responds properly."""
close_code: Optional[WSCloseCode] = None
got_close_code = asyncio.Event()

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

Expand Down
Loading