Skip to content

Commit 77c0115

Browse files
authored
Fix flakey test_content_length_limit_with_multiple_reads test (#10938)
1 parent 597161d commit 77c0115

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tests/test_client_functional.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4293,7 +4293,10 @@ async def data_generator() -> AsyncIterator[bytes]:
42934293
headers = {"Content-Length": "800"}
42944294

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

42984301
# Verify only 800 bytes (not the full 1200) were received by the server
42994302
assert len(received_data) == 800

0 commit comments

Comments
 (0)