Skip to content

Commit 69182c7

Browse files
[PR #10938/77c0115e backport][3.12] Fix flakey test_content_length_limit_with_multiple_reads test (#10939)
Co-authored-by: J. Nick Koston <[email protected]>
1 parent 38c23ed commit 69182c7

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
@@ -4222,7 +4222,10 @@ async def data_generator() -> AsyncIterator[bytes]:
42224222
headers = {"Content-Length": "800"}
42234223

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

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

0 commit comments

Comments
 (0)