Skip to content

Commit 9a2835a

Browse files
[PR #10907/b25eca01 backport][3.12] Fix flakey test_uvloop_secure_https_proxy test (#10909)
Co-authored-by: J. Nick Koston <[email protected]>
1 parent f543fea commit 9a2835a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/test_proxy_functional.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ async def test_uvloop_secure_https_proxy(
218218
uvloop_loop: asyncio.AbstractEventLoop,
219219
) -> None:
220220
"""Ensure HTTPS sites are accessible through a secure proxy without warning when using uvloop."""
221-
conn = aiohttp.TCPConnector()
221+
conn = aiohttp.TCPConnector(force_close=True)
222222
sess = aiohttp.ClientSession(connector=conn)
223223
try:
224224
url = URL("https://example.com")
@@ -227,6 +227,8 @@ async def test_uvloop_secure_https_proxy(
227227
url, proxy=secure_proxy_url, ssl=client_ssl_ctx
228228
) as response:
229229
assert response.status == 200
230+
# Ensure response body is read to completion
231+
await response.read()
230232
finally:
231233
await sess.close()
232234
await conn.close()

0 commit comments

Comments
 (0)