Skip to content

Commit b25eca0

Browse files
authored
Fix flakey test_uvloop_secure_https_proxy test (#10907)
1 parent 4624fed commit b25eca0

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
@@ -255,7 +255,7 @@ async def test_uvloop_secure_https_proxy(
255255
uvloop_loop: asyncio.AbstractEventLoop,
256256
) -> None:
257257
"""Ensure HTTPS sites are accessible through a secure proxy without warning when using uvloop."""
258-
conn = aiohttp.TCPConnector()
258+
conn = aiohttp.TCPConnector(force_close=True)
259259
sess = aiohttp.ClientSession(connector=conn)
260260
try:
261261
url = URL("https://example.com")
@@ -264,6 +264,8 @@ async def test_uvloop_secure_https_proxy(
264264
url, proxy=secure_proxy_url, ssl=client_ssl_ctx
265265
) as response:
266266
assert response.status == 200
267+
# Ensure response body is read to completion
268+
await response.read()
267269
finally:
268270
await sess.close()
269271
await conn.close()

0 commit comments

Comments
 (0)