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: test_ssl of test_asyncio uses LONG_TIMEOUT #92402

Merged
merged 1 commit into from
May 6, 2022
Merged

gh-90978: test_ssl of test_asyncio uses LONG_TIMEOUT #92402

merged 1 commit into from
May 6, 2022

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented May 6, 2022

On slow buildbot workers, some test_ssl tests fail randomly because
of short timeout (30 seconds). Use support.LONG_TIMEOUT instead which
is longer and also adjusted (by regrtest --timeout option) on
buildbot workers known to be slow.

On slow buildbot workers, some test_ssl tests fail randomly because
of short timeout (30 seconds). Use support.LONG_TIMEOUT instead which
is longer and also adjusted (by regrtest --timeout option) on
buildbot workers known to be slow.
@bedevere-bot bedevere-bot added tests Tests in the Lib/test dir awaiting core review labels May 6, 2022
@vstinner
Copy link
Member Author

vstinner commented May 6, 2022

Python 3.10 already uses LONG_TIMEOUT:

TIMEOUT = support.LONG_TIMEOUT

@vstinner
Copy link
Member Author

vstinner commented May 6, 2022

cc @zooba

@vstinner
Copy link
Member Author

vstinner commented May 6, 2022

There is no need to backport the change to Python 3.10. In Python 3.10, it's a different filename and it already uses LONG_TIMEOUT.

@vstinner
Copy link
Member Author

vstinner commented May 6, 2022

@pablogsal: Here is a fix for the x86 Gentoo buildbot.

@vstinner
Copy link
Member Author

vstinner commented May 6, 2022

test_asyncio.test_create_server_ssl_over_ssl() failed on x86 Gentoo Non-Debug with X 3.x: https://buildbot.python.org/all/#/builders/58/builds/2300

IMO the problem is the hardcoded timeout of 30 seconds. This change increases it to 5 minutes (or longer, it's adapted to the buidbot --timeout argument).

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.nondebug/build/Lib/test/test_asyncio/test_ssl.py", line 1090, in do
    rv = func(*args)
         ^^^^^^^^^^^
  File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/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.nondebug/build/Lib/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.nondebug/build/Lib/asyncio/base_events.py", line 650, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/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.nondebug/build/Lib/asyncio/tasks.py", line 488, in wait_for
    return fut.result()
           ^^^^^^^^^^^^
  File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/test/test_asyncio/test_ssl.py", line 1128, in test_client
    await fut
    ^^^^^^^^^
  File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/test/test_asyncio/test_ssl.py", line 1109, in prog
    chunk = do(sslobj.read, 4)
            ^^^^^^^^^^^^^^^^^^
  File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/test/test_asyncio/test_ssl.py", line 1095, in do
    incoming.write(sock.recv(65536))
                   ^^^^^^^^^^^^^^^^
  File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/ssl.py", line 1263, in recv
    return self.read(buflen)
           ^^^^^^^^^^^^^^^^^
  File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.nondebug/build/Lib/ssl.py", line 1136, in read
    return self._sslobj.read(len)
           ^^^^^^^^^^^^^^^^^^^^^^
TimeoutError: The read operation timed out

Copy link
Contributor

@asvetlov asvetlov left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for the PR!

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.

4 participants