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

test_asyncio: sendfile tests fail on AMD64 Debian root 3.7 when _ssl is missing #83187

Closed
vstinner opened this issue Dec 9, 2019 · 10 comments
Closed
Assignees
Labels
3.7 only security fixes 3.8 only security fixes 3.9 only security fixes tests Tests in the Lib/test dir

Comments

@vstinner
Copy link
Member

vstinner commented Dec 9, 2019

BPO 39006
Nosy @vstinner, @tiran, @asvetlov, @pablogsal, @miss-islington
PRs
  • bpo-39006: Fix asyncio when the ssl module is missing #17524
  • [3.8] bpo-39006: Fix asyncio when the ssl module is missing (GH-17524) #17527
  • [3.7] bpo-39006: Fix asyncio when the ssl module is missing (GH-17524) #17528
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/tiran'
    closed_at = <Date 2019-12-09.14:04:23.766>
    created_at = <Date 2019-12-09.13:33:26.545>
    labels = ['3.8', '3.7', 'tests', '3.9']
    title = 'test_asyncio: sendfile tests fail on AMD64 Debian root 3.7 when _ssl is missing'
    updated_at = <Date 2019-12-09.14:20:31.145>
    user = 'https://github.com/vstinner'

    bugs.python.org fields:

    activity = <Date 2019-12-09.14:20:31.145>
    actor = 'miss-islington'
    assignee = 'christian.heimes'
    closed = True
    closed_date = <Date 2019-12-09.14:04:23.766>
    closer = 'vstinner'
    components = ['Tests']
    creation = <Date 2019-12-09.13:33:26.545>
    creator = 'vstinner'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 39006
    keywords = ['patch']
    message_count = 10.0
    messages = ['358079', '358080', '358081', '358082', '358085', '358088', '358090', '358091', '358099', '358100']
    nosy_count = 5.0
    nosy_names = ['vstinner', 'christian.heimes', 'asvetlov', 'pablogsal', 'miss-islington']
    pr_nums = ['17524', '17527', '17528']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue39006'
    versions = ['Python 3.7', 'Python 3.8', 'Python 3.9']

    @vstinner
    Copy link
    Member Author

    vstinner commented Dec 9, 2019

    Pablo wrote on the buildbot-status mailing list:
    "It seems that this worker has some bad upgrade to SSL as all branches fail at the same time:"

    AMD64 Debian root 3.7:
    https://buildbot.python.org/all/#builders/3/builds/8

    ======================================================================
    ERROR: test_sock_sendfile_exception (test.test_asyncio.test_unix_events.SelectorEventLoopUnixSockSendfileTests)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "/root/buildarea/3.7.angelico-debian-amd64/build/Lib/test/test_asyncio/test_unix_events.py", line 613, in test_sock_sendfile_exception
        sock, proto = self.prepare()
      File "/root/buildarea/3.7.angelico-debian-amd64/build/Lib/test/test_asyncio/test_unix_events.py", line 491, in prepare
        self.run_loop(self.loop.sock_connect(sock, (support.HOST, port)))
      File "/root/buildarea/3.7.angelico-debian-amd64/build/Lib/test/test_asyncio/test_unix_events.py", line 481, in run_loop
        return self.loop.run_until_complete(coro)
      File "/root/buildarea/3.7.angelico-debian-amd64/build/Lib/asyncio/base_events.py", line 579, in run_until_complete
        return future.result()
      File "/root/buildarea/3.7.angelico-debian-amd64/build/Lib/asyncio/selector_events.py", line 460, in sock_connect
        if isinstance(sock, ssl.SSLSocket):
    AttributeError: 'NoneType' object has no attribute 'SSLSocket'

    ======================================================================
    ERROR: test_sock_sendfile_iobuffer (test.test_asyncio.test_unix_events.SelectorEventLoopUnixSockSendfileTests)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "/root/buildarea/3.7.angelico-debian-amd64/build/Lib/test/test_asyncio/test_unix_events.py", line 524, in test_sock_sendfile_iobuffer
        sock, proto = self.prepare()
      File "/root/buildarea/3.7.angelico-debian-amd64/build/Lib/test/test_asyncio/test_unix_events.py", line 491, in prepare
        self.run_loop(self.loop.sock_connect(sock, (support.HOST, port)))
      File "/root/buildarea/3.7.angelico-debian-amd64/build/Lib/test/test_asyncio/test_unix_events.py", line 481, in run_loop
        return self.loop.run_until_complete(coro)
      File "/root/buildarea/3.7.angelico-debian-amd64/build/Lib/asyncio/base_events.py", line 579, in run_until_complete
        return future.result()
      File "/root/buildarea/3.7.angelico-debian-amd64/build/Lib/asyncio/selector_events.py", line 460, in sock_connect
        if isinstance(sock, ssl.SSLSocket):
    AttributeError: 'NoneType' object has no attribute 'SSLSocket'

    ======================================================================
    ERROR: test_sock_sendfile_not_a_file (test.test_asyncio.test_unix_events.SelectorEventLoopUnixSockSendfileTests)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "/root/buildarea/3.7.angelico-debian-amd64/build/Lib/test/test_asyncio/test_unix_events.py", line 515, in test_sock_sendfile_not_a_file
        sock, proto = self.prepare()
      File "/root/buildarea/3.7.angelico-debian-amd64/build/Lib/test/test_asyncio/test_unix_events.py", line 491, in prepare
        self.run_loop(self.loop.sock_connect(sock, (support.HOST, port)))
      File "/root/buildarea/3.7.angelico-debian-amd64/build/Lib/test/test_asyncio/test_unix_events.py", line 481, in run_loop
        return self.loop.run_until_complete(coro)
      File "/root/buildarea/3.7.angelico-debian-amd64/build/Lib/asyncio/base_events.py", line 579, in run_until_complete
        return future.result()
      File "/root/buildarea/3.7.angelico-debian-amd64/build/Lib/asyncio/selector_events.py", line 460, in sock_connect
        if isinstance(sock, ssl.SSLSocket):
    AttributeError: 'NoneType' object has no attribute 'SSLSocket'

    @vstinner vstinner added topic-SSL 3.7 only security fixes labels Dec 9, 2019
    @vstinner vstinner added tests Tests in the Lib/test dir labels Dec 9, 2019
    @vstinner
    Copy link
    Member Author

    vstinner commented Dec 9, 2019

    """
    Python build finished successfully!
    The necessary bits to build these optional modules were not found:
    _ssl _tkinter _uuid
    """

    The _ssl module was not built on this worker, so why test_ssl was not skipped?

    @vstinner vstinner changed the title test_ssl: sendfile tests fail on AMD64 Debian root 3.7 test_ssl: sendfile tests fail on AMD64 Debian root 3.7 when _ssl is missing Dec 9, 2019
    @vstinner vstinner changed the title test_ssl: sendfile tests fail on AMD64 Debian root 3.7 test_ssl: sendfile tests fail on AMD64 Debian root 3.7 when _ssl is missing Dec 9, 2019
    @vstinner vstinner removed the topic-SSL label Dec 9, 2019
    @vstinner vstinner changed the title test_ssl: sendfile tests fail on AMD64 Debian root 3.7 when _ssl is missing test_asyncio: sendfile tests fail on AMD64 Debian root 3.7 when _ssl is missing Dec 9, 2019
    @vstinner vstinner removed the topic-SSL label Dec 9, 2019
    @vstinner vstinner changed the title test_ssl: sendfile tests fail on AMD64 Debian root 3.7 when _ssl is missing test_asyncio: sendfile tests fail on AMD64 Debian root 3.7 when _ssl is missing Dec 9, 2019
    @tiran
    Copy link
    Member

    tiran commented Dec 9, 2019

    I don't see test_ssl.py in the logs. test_unix_events.py is failing because it is missing a check for _ssl.

    @vstinner
    Copy link
    Member Author

    vstinner commented Dec 9, 2019

    Same issue on AMD64 Debian root 3.8:
    https://buildbot.python.org/all/#builders/162/builds/14

    And AMD64 Debian root 3.x:
    https://buildbot.python.org/all/#builders/225/builds/28

    @vstinner vstinner added 3.8 only security fixes 3.9 only security fixes labels Dec 9, 2019
    @asvetlov
    Copy link
    Contributor

    asvetlov commented Dec 9, 2019

    Sorry, my fault.

    @tiran
    Copy link
    Member

    tiran commented Dec 9, 2019

    The problem was introduced by https://bugs.python.org/issue37404. I created #17526 to fix the problem and address a minor performance regression.

    @vstinner
    Copy link
    Member Author

    vstinner commented Dec 9, 2019

    New changeset 82b4950 by Victor Stinner in branch 'master':
    bpo-39006: Fix asyncio when the ssl module is missing (GH-17524)
    82b4950

    @vstinner
    Copy link
    Member Author

    vstinner commented Dec 9, 2019

    I wrote a fix which was approved by Andrew Svetlov. Andrew prefers my PR than Christian's PR 17526, so I merged my PR instead. See PR 17526 discussion for the rationale.

    I merged your PR to master, 3.7 and 3.8 backport will automatically follow. I close the issue.

    @miss-islington
    Copy link
    Contributor

    New changeset b22183f by Miss Islington (bot) in branch '3.8':
    bpo-39006: Fix asyncio when the ssl module is missing (GH-17524)
    b22183f

    @miss-islington
    Copy link
    Contributor

    New changeset a0078d9 by Miss Islington (bot) in branch '3.7':
    bpo-39006: Fix asyncio when the ssl module is missing (GH-17524)
    a0078d9

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.7 only security fixes 3.8 only security fixes 3.9 only security fixes tests Tests in the Lib/test dir
    Projects
    None yet
    Development

    No branches or pull requests

    4 participants