Skip to content
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

Implement binding to IPv6 addresses in the pytest server fixture. #4650

Merged

Conversation

tan01
Copy link
Contributor

@tan01 tan01 commented Mar 20, 2020

What do these changes do?

This change allows TestServer to be instantiated with IPv6 hostnames.
Previously, the TestServer would open an IPv4 family socket regardless
of hostname, causing an error to be raised upon starting the server.
The BaseTestServer now parses the hostname and create an IPv4 or
IPv6 socket based on the hostname.

Are there changes in behavior for the user?

Creating a TestServer from test_utils.py with an IPv6 hostname ('::1') no longer throws

 socket.gaierror: [Errno -9] Address family for hostname not supported

Related issue number

None

Checklist

  • I think the code is well written
  • Unit tests for the changes exist
  • Documentation reflects the changes
  • If you provide code modification, please add yourself to CONTRIBUTORS.txt
    • The format is <Name> <Surname>.
    • Please keep alphabetical order, the file is sorted by names.
  • Add a new news fragment into the CHANGES folder
    • name it <issue_id>.<type> for example (588.bugfix)
    • if you don't have an issue_id change it to the pr id after creating the pr
    • ensure type is one of the following:
      • .feature: Signifying a new feature.
      • .bugfix: Signifying a bug fix.
      • .doc: Signifying a documentation improvement.
      • .removal: Signifying a deprecation or removal of public API.
      • .misc: A ticket has been closed, but it is not of interest to users.
    • Make sure to use full sentences with correct case and punctuation, for example: "Fix issue with non-ascii contents in doctest text files."

@tan01 tan01 requested a review from asvetlov as a code owner March 20, 2020 01:16
@codecov-io

This comment has been minimized.

@webknjaz
Copy link
Member

Plz go through the checklist/add a change fragment.

This change allows TestServer to be instantiated with IPv6 hostnames.
Previously, the TestServer would open an IPv4 family socket regardless
of hostname, causing an error to be raised upon starting the server.
The BaseTestServer now parses the hostname and create an IPv4 or
IPv6 socket based on the hostname.
@tan01 tan01 force-pushed the user/tan01/bugfix/ipv6_test_utils_server branch from c0120b2 to 525f369 Compare March 20, 2020 16:11
@psf-chronographer psf-chronographer bot added the bot:chronographer:provided There is a change note present in this PR label Mar 20, 2020
Copy link
Contributor Author

@tan01 tan01 left a comment

Choose a reason for hiding this comment

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

Went through the checklist, added change fragment/modified contributors.

CHANGES/4650.bugfix Outdated Show resolved Hide resolved
aiohttp/test_utils.py Outdated Show resolved Hide resolved
aiohttp/test_utils.py Outdated Show resolved Hide resolved
tests/test_test_utils.py Outdated Show resolved Hide resolved
tan01 and others added 4 commits March 20, 2020 16:21
Co-Authored-By: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
Co-Authored-By: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
Co-Authored-By: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
@tan01 tan01 changed the title Modify test_utils.BaseTestServer to allow IPv6 hostnames Implement binding to IPv6 addresses in the pytest server fixture. Mar 20, 2020
@webknjaz webknjaz merged commit 6312f9c into aio-libs:master Mar 22, 2020
asvetlov pushed a commit that referenced this pull request Oct 16, 2020
PR #4650 by @tan01

This change allows TestServer to be instantiated with IPv6 hostnames.
Previously, the TestServer would open an IPv4 family socket regardless
of hostname, causing an error to be raised upon starting the server.
The BaseTestServer now parses the hostname and create an IPv4 or
IPv6 socket based on the hostname.

Co-Authored-By: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
Mic92 pushed a commit to Mic92/aiohttp that referenced this pull request Sep 11, 2024
PR aio-libs#4650 by @tan01

This change allows TestServer to be instantiated with IPv6 hostnames.
Previously, the TestServer would open an IPv4 family socket regardless
of hostname, causing an error to be raised upon starting the server.
The BaseTestServer now parses the hostname and create an IPv4 or
IPv6 socket based on the hostname.

Co-Authored-By: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
Mic92 pushed a commit to Mic92/aiohttp that referenced this pull request Sep 11, 2024
PR aio-libs#4650 by @tan01

This change allows TestServer to be instantiated with IPv6 hostnames.
Previously, the TestServer would open an IPv4 family socket regardless
of hostname, causing an error to be raised upon starting the server.
The BaseTestServer now parses the hostname and create an IPv4 or
IPv6 socket based on the hostname.

Co-Authored-By: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
Mic92 pushed a commit to Mic92/aiohttp that referenced this pull request Sep 11, 2024
PR aio-libs#4650 by @tan01

This change allows TestServer to be instantiated with IPv6 hostnames.
Previously, the TestServer would open an IPv4 family socket regardless
of hostname, causing an error to be raised upon starting the server.
The BaseTestServer now parses the hostname and create an IPv4 or
IPv6 socket based on the hostname.

Co-Authored-By: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot:chronographer:provided There is a change note present in this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants