Skip to content

gh-160206: Close connection explicitly in test_ssl - #160222

Merged
vstinner merged 1 commit into
python:mainfrom
vstinner:test_ssl
Oct 22, 2026
Merged

vstinner merged 1 commit into
python:mainfrom
vstinner:test_ssl

Conversation

@vstinner

@vstinner vstinner commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

test_https_client_non_tls_response_ignored() now uses a context manager for the server and always closes the connection to avoid ResourceWarning.

Also add a timeout to SingleConnectionTestServerThread.exit() to not hang forever if something goes wrong.

test_https_client_non_tls_response_ignored() now uses a context
manager for the server and always closes the connection to avoid
ResourceWarning.

Also add a timeout to SingleConnectionTestServerThread.__exit__() to
not hang forever if something goes wrong.
@vstinner

Copy link
Copy Markdown
Member Author

!buildbot FreeBSD

@bedevere-bot

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @vstinner for commit ed70e48 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F160222%2Fmerge

The command will test the builders whose names match following regular expression: FreeBSD

The builders matched are:

  • AMD64 FreeBSD16 Non-Debug PR
  • AMD64 FreeBSD15 PR
  • AMD64 FreeBSD16 PR
  • AMD64 FreeBSD15 NoGIL PR
  • AMD64 FreeBSD Refleaks PR
  • AMD64 FreeBSD14 PR

@vstinner

Copy link
Copy Markdown
Member Author

test_ssl passed on the 6 FreeBSD jobs.

@vstinner
vstinner merged commit 9d42aee into python:main Oct 22, 2026
67 of 68 checks passed
@vstinner
vstinner deleted the test_ssl branch October 22, 2026 17:43
@miss-islington-app

Copy link
Copy Markdown

Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14, 3.15.
🐍🍒⛏🤖

@bedevere-app

bedevere-app Bot commented Oct 22, 2026

Copy link
Copy Markdown

GH-160273 is a backport of this pull request to the 3.15 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 bugs and security fixes label Oct 22, 2026
@bedevere-app

bedevere-app Bot commented Oct 22, 2026

Copy link
Copy Markdown

GH-160274 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Oct 22, 2026
vstinner added a commit that referenced this pull request Oct 22, 2026
…#160273)

gh-160206: Close connection explicitly in test_ssl (GH-160222)

test_https_client_non_tls_response_ignored() now uses a context
manager for the server and always closes the connection to avoid
ResourceWarning.

Also add a timeout to SingleConnectionTestServerThread.__exit__() to
not hang forever if something goes wrong.
(cherry picked from commit 9d42aee)

Co-authored-by: Victor Stinner <vstinner@python.org>
vstinner added a commit that referenced this pull request Oct 22, 2026
…#160274)

gh-160206: Close connection explicitly in test_ssl (GH-160222)

test_https_client_non_tls_response_ignored() now uses a context
manager for the server and always closes the connection to avoid
ResourceWarning.

Also add a timeout to SingleConnectionTestServerThread.__exit__() to
not hang forever if something goes wrong.
(cherry picked from commit 9d42aee)

Co-authored-by: Victor Stinner <vstinner@python.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip news tests Tests in the Lib/test dir topic-SSL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants