FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[3.9] gh-108342: Make ssl TestPreHandshakeClose more reliable (GH-108370) by ambv · Pull Request #108407 · python/cpython · GitHub

Repository navigation

[3.9] gh-108342: Make ssl TestPreHandshakeClose more reliable (GH-108370) - #108407

Merged
ambv merged 1 commit into
python:3.9from
ambv:backport-592bacb-3.9
Aug 24, 2023
Merged

ambv merged 1 commit into
python:3.9from
ambv:backport-592bacb-3.9

Conversation

ambv commented Aug 24, 2023 •
edited by bedevere-bot
Loading

Copy link
Copy Markdown
Contributor
  • In preauth tests of test_ssl, explicitly break reference cycles invoving SingleConnectionTestServerThread to make sure that the thread is deleted. Otherwise, the test marks the environment as altered because the threading module sees a "dangling thread" (SingleConnectionTestServerThread). This test leak was introduced by the test added for the fix of issue CVE-2023-40217: Bypass TLS handshake on closed sockets #108310.
  • Use support.SHORT_TIMEOUT instead of hardcoded 1.0 or 2.0 seconds timeout.
  • SingleConnectionTestServerThread.run() catchs TimeoutError
  • Fix a race condition (missing synchronization) in test_preauth_data_to_tls_client(): the server now waits until the client connect() completed in call_after_accept().
  • test_https_client_non_tls_response_ignored() calls server.join() explicitly.
  • Replace "localhost" with server.listener.getsockname()[0]. (cherry picked from commit 592bacb)

…ythonGH-108370)

* In preauth tests of test_ssl, explicitly break reference cycles
  invoving SingleConnectionTestServerThread to make sure that the
  thread is deleted. Otherwise, the test marks the environment as
  altered because the threading module sees a "dangling thread"
  (SingleConnectionTestServerThread). This test leak was introduced
  by the test added for the fix of issue pythongh-108310.
* Use support.SHORT_TIMEOUT instead of hardcoded 1.0 or 2.0 seconds
  timeout.
* SingleConnectionTestServerThread.run() catchs TimeoutError
* Fix a race condition (missing synchronization) in
  test_preauth_data_to_tls_client(): the server now waits until the
  client connect() completed in call_after_accept().
* test_https_client_non_tls_response_ignored() calls server.join()
  explicitly.
* Replace "localhost" with server.listener.getsockname()[0].
(cherry picked from commit 592bacb)

Co-authored-by: Victor Stinner <vstinner@python.org>
ambv requested a review from tiran as a code owner August 24, 2023 09:02
bedevere-bot added tests Tests in the Lib/test dir awaiting core review labels Aug 24, 2023
ambv merged commit d2cd0a3 into python:3.9 Aug 24, 2023
ambv deleted the backport-592bacb-3.9 branch August 24, 2023 10:09
ambv restored the backport-592bacb-3.9 branch August 24, 2023 10:54
ambv deleted the backport-592bacb-3.9 branch August 24, 2023 10:54
carlosroman pushed a commit to DataDog/cpython that referenced this pull request Oct 11, 2023
…ythonGH-108370) (python#108407)

* In preauth tests of test_ssl, explicitly break reference cycles
  invoving SingleConnectionTestServerThread to make sure that the
  thread is deleted. Otherwise, the test marks the environment as
  altered because the threading module sees a "dangling thread"
  (SingleConnectionTestServerThread). This test leak was introduced
  by the test added for the fix of issue pythongh-108310.
* Use support.SHORT_TIMEOUT instead of hardcoded 1.0 or 2.0 seconds
  timeout.
* SingleConnectionTestServerThread.run() catchs TimeoutError
* Fix a race condition (missing synchronization) in
  test_preauth_data_to_tls_client(): the server now waits until the
  client connect() completed in call_after_accept().
* test_https_client_non_tls_response_ignored() calls server.join()
  explicitly.
* Replace "localhost" with server.listener.getsockname()[0].
(cherry picked from commit 592bacb)

Co-authored-by: Victor Stinner <vstinner@python.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL