8000 gh-131178: fix SSL tests for `http.server` command-line interface by ggqlq · Pull Request #134224 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-131178: fix SSL tests for http.server command-line interface #134224

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

Closed
wants to merge 89 commits into from

Conversation

ggqlq
Copy link
Contributor
@ggqlq ggqlq commented May 19, 2025

ggqlq and others added 30 commits April 15, 2025 02:38
Co-authored-by: Semyon Moroz <donbarbos@proton.me>
Co-authored-by: Semyon Moroz <donbarbos@proton.me>
Co-authored-by: Semyon Moroz <donbarbos@proton.me>
Co-authored-by: Semyon Moroz <donbarbos@proton.me>
Co-authored-by: Semyon Moroz <donbarbos@proton.me>
Co-authored-by: Semyon Moroz <donbarbos@proton.me>
Co-authored-by: Semyon Moroz <donbarbos@proton.me>
Co-authored-by: Semyon Moroz <donbarbos@proton.me>
Co-authored-by: Semyon Moroz <donbarbos@proton.me>
Co-authored-by: Semyon Moroz <donbarbos@proton.me>
Co-authored-by: Semyon Moroz <donbarbos@proton.me>
Co-authored-by: Semyon Moroz <donbarbos@proton.me>
Co-authored-by: Semyon Moroz <donbarbos@proton.me>
Co-authored-by: Semyon Moroz <donbarbos@proton.me>
Co-authored-by: Semyon Moroz <donbarbos@proton.me>
Co-authored-by: Semyon Moroz <donbarbos@proton.me>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
@picnixz
Copy link
Member
picnixz commented May 19, 2025

!buildbot ASAN

@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @picnixz for commit 0e0fb7a 🤖

Results will be shown at:

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

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

The builders matched are:

  • AMD64 Arch Linux Asan PR
  • AMD64 Arch Linux Asan Debug PR
  • x86-64 MacOS Intel ASAN NoGIL PR

@picnixz
Copy link
Member
picnixz commented May 19, 2025

!buildbot x86-64 MacOS Intel ASAN NoGIL PR

@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @picnixz for commit e818bb6 🤖

Results will be shown at:

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

The command will test the builders whose names match following regular expression: x86-64 MacOS Intel ASAN NoGIL PR

The builders matched are:

  • x86-64 MacOS Intel ASAN NoGIL PR

@picnixz
Copy link
Member
picnixz commented May 19, 2025

So the failures are the following:

======================================================================
ERROR: test_http_client (test.test_httpservers.CommandLineRunTimeTestCase.test_http_client)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/ec2-user/buildbot/buildarea/3.x.itamaro-macos-intel-aws.macos-with-brew.asan.nogil/build/Lib/test/test_httpservers.py", line 1520, in test_http_client
    res = self.fetch_file(f'http://{bind}:{port}/{self.served_file_name}')
  File "/Users/ec2-user/buildbot/buildarea/3.x.itamaro-macos-intel-aws.macos-with-brew.asan.nogil/build/Lib/test/test_httpservers.py", line 1476, in fetch_file
    context = ssl.create_default_context()
              ^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'create_default_context'

======================================================================
FAIL: test_https_client (test.test_httpservers.CommandLineRunTimeTestCase.test_https_client)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/ec2-user/buildbot/buildarea/3.x.itamaro-macos-intel-aws.macos-with-brew.asan.nogil/build/Lib/test/test_httpservers.py", line 1533, in test_https_client
    self.assertTrue(self.wait_for_server(proc, 'https', port, bind))
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: False is not true

----------------------------------------------------------------------

We fixed the AttributeError, but I don't know why the other happens.

@picnixz
Copy link
Member
picnixz commented May 19, 2025

Note: using localhost instead of 127.0.0.1 doesn't seem the right solution as we also have tests with 127.0.0.1 elsewhere.

However, maybe we can just ignore the bind itself and check for the "best" address (which is chosen by http.server via _get_best_family).

@picnixz
Copy link
Member
picnixz commented May 19, 2025

I've committed directly to your branch as the tier-1 bot is failing (making it hard to fix another issue I introduced in a subsequent commit, not your fault!)

@picnixz
Copy link
Member
picnixz commented May 19, 2025

!buildbot x86-64 MacOS Intel ASAN NoGIL PR

@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @picnixz for commit 9192281 🤖

Results will be shown at:

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

The command will test the builders whose names match following regular expression: x86-64 MacOS Intel ASAN NoGIL PR

The builders matched are:

  • x86-64 MacOS Intel ASAN NoGIL PR

@picnixz

This comment was marked as resolved.

@picnixz
Copy link
Member
picnixz commented May 19, 2025

Ok, so the tests now hang on non-Linux bots. I'll stop working on this branch and will come back on my linux in a few hours.

Copy link
Member
@picnixz picnixz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So localhost doesn't work and 127.0.0.1 doesn't work for some build bots. I think we'll just leave it to the script the responsibility to start the server and we'll deduce the bind address from the output.

@picnixz
Copy link
Member
picnixz commented May 19, 2025

Ok, so now, the tests entirely hang for some obscure reasons. I'll open a new PR instead, sorry for messing up your branch though (but thank you for your quick response time).

@picnixz picnixz closed this May 19, 2025
@picnixz
Copy link
Member
picnixz commented May 19, 2025

I've opened #134279

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting merge skip news tests Tests in the Lib/test dir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0