Skip to content

Fix flakey test_content_length_limit_with_multiple_reads test #10938

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
5 changes: 4 additions & 1 deletion tests/test_client_functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -4291,7 +4291,10 @@ async def data_generator() -> AsyncIterator[bytes]:
headers = {"Content-Length": "800"}

async with aiohttp.ClientSession() as session:
await session.post(server.make_url("/"), data=data_generator(), headers=headers)
async with session.post(
server.make_url("/"), data=data_generator(), headers=headers
) as resp:
await resp.read() # Ensure response is fully read and connection cleaned up

# Verify only 800 bytes (not the full 1200) were received by the server
assert len(received_data) == 800
Expand Down
Loading