Skip to content

[PR #10907/b25eca01 backport][3.11] Fix flakey test_uvloop_secure_https_proxy test #10908

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
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
4 changes: 3 additions & 1 deletion tests/test_proxy_functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ async def test_uvloop_secure_https_proxy(
secure_proxy_url: URL,
) -> None:
"""Ensure HTTPS sites are accessible through a secure proxy without warning when using uvloop."""
conn = aiohttp.TCPConnector()
conn = aiohttp.TCPConnector(force_close=True)
sess = aiohttp.ClientSession(connector=conn)
try:
url = URL("https://example.com")
Expand All @@ -227,6 +227,8 @@ async def test_uvloop_secure_https_proxy(
url, proxy=secure_proxy_url, ssl=client_ssl_ctx
) as response:
assert response.status == 200
# Ensure response body is read to completion
await response.read()
finally:
await sess.close()
await conn.close()
Expand Down
Loading