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

gh-90978: asyncio TestSSL uses SHORT_TIMEOUT #92642

Merged
merged 1 commit into from May 11, 2022

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented May 10, 2022

TestSSL of asyncio now uses support.SHORT_TIMEOUT rather than
hardcoded timeouts like 5, 10 or 40 seconds.

TestSSL of asyncio now uses support.SHORT_TIMEOUT rather than
hardcoded timeouts like 5, 10 or 40 seconds.
@vstinner
Copy link
Member Author

@vstinner vstinner commented May 10, 2022

Follow-up of PR #92402. See issue gh-90978.

Example of recent failure on x86 Gentoo Installed with X 3.x:

ERROR: test_create_server_ssl_over_ssl (test.test_asyncio.test_ssl.TestSSL.test_create_server_ssl_over_ssl)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.installed/build/target/lib/python3.12/test/test_asyncio/test_ssl.py", line 1090, in do
    rv = func(*args)
         ^^^^^^^^^^^
  File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.installed/build/target/lib/python3.12/ssl.py", line 921, in read
    v = self._sslobj.read(len)
        ^^^^^^^^^^^^^^^^^^^^^^
ssl.SSLWantReadError: The operation did not complete (read) (_ssl.c:2546)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.installed/build/target/lib/python3.12/test/test_asyncio/test_ssl.py", line 1157, in test_create_server_ssl_over_ssl
    self.loop.run_until_complete(start_server())
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.installed/build/target/lib/python3.12/asyncio/base_events.py", line 650, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.installed/build/target/lib/python3.12/test/test_asyncio/test_ssl.py", line 1150, in start_server
    await asyncio.wait_for(asyncio.gather(*tasks), TIMEOUT)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.installed/build/target/lib/python3.12/asyncio/tasks.py", line 488, in wait_for
    return fut.result()
           ^^^^^^^^^^^^
  File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.installed/build/target/lib/python3.12/test/test_asyncio/test_ssl.py", line 1128, in test_client
    await fut
    ^^^^^^^^^
  File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.installed/build/target/lib/python3.12/test/test_asyncio/test_ssl.py", line 1103, in prog
    data = do(sslobj.read, 2)
           ^^^^^^^^^^^^^^^^^^
  File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.installed/build/target/lib/python3.12/test/test_asyncio/test_ssl.py", line 1095, in do
    incoming.write(sock.recv(65536))
                   ^^^^^^^^^^^^^^^^
  File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.installed/build/target/lib/python3.12/ssl.py", line 1263, in recv
    return self.read(buflen)
           ^^^^^^^^^^^^^^^^^
  File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.installed/build/target/lib/python3.12/ssl.py", line 1136, in read
    return self._sslobj.read(len)
           ^^^^^^^^^^^^^^^^^^^^^^
TimeoutError: The read operation timed out

https://buildbot.python.org/all/#/builders/464/builds/2336

@vstinner
Copy link
Member Author

@vstinner vstinner commented May 10, 2022

@asvetlov @pablogsal: More changes to avoid hardcoded timeouts.

@vstinner vstinner merged commit 1d1929f into python:main May 11, 2022
13 checks passed
@miss-islington
Copy link
Contributor

@miss-islington miss-islington commented May 11, 2022

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

@vstinner vstinner deleted the asyncio_test_ssl_timeout branch May 11, 2022
miss-islington pushed a commit to miss-islington/cpython that referenced this issue May 11, 2022
TestSSL of asyncio now uses support.SHORT_TIMEOUT rather than
hardcoded timeouts like 5, 10 or 40 seconds.
(cherry picked from commit 1d1929f)

Co-authored-by: Victor Stinner <vstinner@python.org>
@bedevere-bot
Copy link

@bedevere-bot bedevere-bot commented May 11, 2022

GH-92690 is a backport of this pull request to the 3.11 branch.

miss-islington added a commit that referenced this issue May 11, 2022
TestSSL of asyncio now uses support.SHORT_TIMEOUT rather than
hardcoded timeouts like 5, 10 or 40 seconds.
(cherry picked from commit 1d1929f)

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants