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: TLS tests fail on "x86 Windows7" buildbot #76826

Closed
vstinner opened this issue Jan 24, 2018 · 11 comments
Closed

test_asyncio: TLS tests fail on "x86 Windows7" buildbot #76826

vstinner opened this issue Jan 24, 2018 · 11 comments
Labels
3.7 (EOL) end of life OS-windows tests Tests in the Lib/test dir topic-asyncio

Comments

@vstinner
Copy link
Member

BPO 32645
Nosy @terryjreedy, @pfmoore, @vstinner, @tjguk, @asvetlov, @zware, @1st1, @zooba

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 = None
closed_at = <Date 2018-01-29.12:20:39.927>
created_at = <Date 2018-01-24.09:49:28.634>
labels = ['3.7', 'tests', 'OS-windows', 'expert-asyncio']
title = 'test_asyncio: TLS tests fail on "x86 Windows7" buildbot'
updated_at = <Date 2018-01-29.12:23:04.496>
user = 'https://github.com/vstinner'

bugs.python.org fields:

activity = <Date 2018-01-29.12:23:04.496>
actor = 'asvetlov'
assignee = 'none'
closed = True
closed_date = <Date 2018-01-29.12:20:39.927>
closer = 'vstinner'
components = ['Tests', 'Windows', 'asyncio']
creation = <Date 2018-01-24.09:49:28.634>
creator = 'vstinner'
dependencies = []
files = []
hgrepos = []
issue_num = 32645
keywords = []
message_count = 11.0
messages = ['310576', '310603', '310680', '310841', '311101', '311103', '311104', '311106', '311107', '311109', '311111']
nosy_count = 8.0
nosy_names = ['terry.reedy', 'paul.moore', 'vstinner', 'tim.golden', 'asvetlov', 'zach.ware', 'yselivanov', 'steve.dower']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = 'resolved'
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue32645'
versions = ['Python 3.7']

@vstinner
Copy link
Member Author

test_asyncio started to fail after the implementation of STARTTLS in asyncio, bpo-23749: commit f111b3d.

http://buildbot.python.org/all/#/builders/58/builds/502

Extract of test.pythoninfo:
----
ssl.HAS_SNI: True
ssl.OPENSSL_VERSION: OpenSSL 1.1.0f 25 May 2017
ssl.OPENSSL_VERSION_INFO: (1, 1, 0, 6, 15)
ssl.OP_ALL: -0x7fffffac
ssl.OP_NO_TLSv1_1: 0x10000000

sys.version: 3.7.0a4+ (heads/master:018e1b7, Jan 24 2018, 02:53:43) [MSC v.1900 32 bit (Intel)]
sys.version_info: sys.version_info(major=3, minor=7, micro=0, releaselevel='alpha', serial=4)
sys.windowsversion: sys.getwindowsversion(major=6, minor=1, build=7601, platform=2, service_pack='Service Pack 1')
sys.winver: 3.7-32
---

Extract of compile step:
---
Fetching external libraries...
(...)
openssl-bin-1.1.0f already exists, skipping.
---

Test failures:

======================================================================
ERROR: test_start_tls_client_1 (test.test_asyncio.test_sslproto.ProactorStartTLSTests)
----------------------------------------------------------------------

Traceback (most recent call last):
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\test_asyncio\test_sslproto.py", line 225, in test_start_tls_client_1
    asyncio.wait_for(client(srv.addr), loop=self.loop, timeout=10))
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\asyncio\base_events.py", line 436, in run_until_complete
    return future.result()
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\asyncio\tasks.py", line 406, in wait_for
    raise futures.TimeoutError()
concurrent.futures._base.TimeoutError

======================================================================
ERROR: test_start_tls_server_1 (test.test_asyncio.test_sslproto.ProactorStartTLSTests)
----------------------------------------------------------------------

Traceback (most recent call last):
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\test_asyncio\test_sslproto.py", line 285, in test_start_tls_server_1
    asyncio.wait_for(main(), loop=self.loop, timeout=10))
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\asyncio\base_events.py", line 436, in run_until_complete
    return future.result()
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\asyncio\tasks.py", line 406, in wait_for
    raise futures.TimeoutError()
concurrent.futures._base.TimeoutError

======================================================================
ERROR: test_start_tls_client_1 (test.test_asyncio.test_sslproto.SelectorStartTLSTests)
----------------------------------------------------------------------

Traceback (most recent call last):
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\test_asyncio\test_sslproto.py", line 225, in test_start_tls_client_1
    asyncio.wait_for(client(srv.addr), loop=self.loop, timeout=10))
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\asyncio\base_events.py", line 436, in run_until_complete
    return future.result()
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\asyncio\tasks.py", line 406, in wait_for
    raise futures.TimeoutError()
concurrent.futures._base.TimeoutError

======================================================================
FAIL: test_start_tls_server_1 (test.test_asyncio.test_sslproto.ProactorStartTLSTests)
----------------------------------------------------------------------

Traceback (most recent call last):
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\test_asyncio\functional.py", line 42, in tearDown
    self.fail('unexpected calls to loop.call_exception_handler()')
AssertionError: unexpected calls to loop.call_exception_handler()

Ran 1651 tests in 117.209s

FAILED (failures=1, errors=3, skipped=56)

@vstinner vstinner added 3.7 (EOL) end of life tests Tests in the Lib/test dir OS-windows topic-asyncio labels Jan 24, 2018
@1st1
Copy link
Member

1st1 commented Jan 24, 2018

I now have a Win7 VM, I'll take a look at this later.

@vstinner
Copy link
Member Author

Build 537 of x86 Tiger 3.x failed, whereas the previous build was a success. Hum, maybe these asyncio failures are "just" race conditions, trigger if the system load is too high? I recall that the Windows 7 buildbot is usually slow/busy.

http://buildbot.python.org/all/#/builders/30/builds/537

======================================================================
ERROR: test_start_tls_client_1 (test.test_asyncio.test_sslproto.SelectorStartTLSTests)
----------------------------------------------------------------------

Traceback (most recent call last):
  File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/test/test_asyncio/test_sslproto.py", line 225, in test_start_tls_client_1
    asyncio.wait_for(client(srv.addr), loop=self.loop, timeout=10))
  File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/asyncio/base_events.py", line 436, in run_until_complete
    return future.result()
  File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/asyncio/tasks.py", line 406, in wait_for
    raise futures.TimeoutError()
concurrent.futures._base.TimeoutError

======================================================================
ERROR: test_start_tls_server_1 (test.test_asyncio.test_sslproto.SelectorStartTLSTests)
----------------------------------------------------------------------

Traceback (most recent call last):
  File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/test/test_asyncio/test_sslproto.py", line 285, in test_start_tls_server_1
    asyncio.wait_for(main(), loop=self.loop, timeout=10))
  File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/asyncio/base_events.py", line 436, in run_until_complete
    return future.result()
  File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/asyncio/tasks.py", line 406, in wait_for
    raise futures.TimeoutError()
concurrent.futures._base.TimeoutError

@terryjreedy
Copy link
Member

I ran f:\dev\3x>python -m test -j5 test_asyncio test_asyncio test_asyncio test_asyncio test_asyncio on fresh Win10 build and got
...
0:01:02 [5/5] test_asyncio passed (62 sec)
F:\dev\3x\lib\asyncio\selector_events.py:648: ResourceWarning: unclosed transport <_SelectorSocketTransport fd=620>
source=self)
F:\dev\3x\lib\asyncio\selector_events.py:648: ResourceWarning: unclosed transport <_SelectorSocketTransport fd=896>
source=self)
F:\dev\3x\lib\asyncio\sslproto.py:318: ResourceWarning: unclosed transport <asyncio.sslproto._SSLProtocolTransport object at 0x05841EE0>
source=self)
All 5 tests OK.
(1 test also gave resource warnings.)

@vstinner
Copy link
Member Author

Different failure on x86 Tiger 3.x:

http://buildbot.python.org/all/#/builders/30/builds/562

======================================================================
ERROR: test_sendfile_ssl (test.test_asyncio.test_events.KqueueEventLoopTests)
----------------------------------------------------------------------

Traceback (most recent call last):
  File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/test/test_asyncio/test_events.py", line 2243, in test_sendfile_ssl
    srv_proto, cli_proto = self.prepare(is_ssl=True)
  File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/test/test_asyncio/test_events.py", line 2136, in prepare
    srv_ctx = test_utils.simple_server_sslcontext()
  File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/test/test_asyncio/utils.py", line 73, in simple_server_sslcontext
    server_context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
AttributeError: 'NoneType' object has no attribute 'SSLContext'

======================================================================
ERROR: test_sendfile_ssl_close_peer_after_receiving (test.test_asyncio.test_events.KqueueEventLoopTests)
----------------------------------------------------------------------

Traceback (most recent call last):
  File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/test/test_asyncio/test_events.py", line 2325, in test_sendfile_ssl_close_peer_after_receiving
    close_after=len(self.DATA))
  File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/test/test_asyncio/test_events.py", line 2136, in prepare
    srv_ctx = test_utils.simple_server_sslcontext()
  File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/test/test_asyncio/utils.py", line 73, in simple_server_sslcontext
    server_context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
AttributeError: 'NoneType' object has no attribute 'SSLContext'

======================================================================
ERROR: test_sendfile_ssl_partial (test.test_asyncio.test_events.KqueueEventLoopTests)
----------------------------------------------------------------------

Traceback (most recent call last):
  File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/test/test_asyncio/test_events.py", line 2302, in test_sendfile_ssl_partial
    srv_proto, cli_proto = self.prepare(is_ssl=True)
  File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/test/test_asyncio/test_events.py", line 2136, in prepare
    srv_ctx = test_utils.simple_server_sslcontext()
  File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/test/test_asyncio/utils.py", line 73, in simple_server_sslcontext
    server_context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
AttributeError: 'NoneType' object has no attribute 'SSLContext'

======================================================================
ERROR: test_sendfile_ssl_pre_and_post_data (test.test_asyncio.test_events.KqueueEventLoopTests)
----------------------------------------------------------------------

Traceback (most recent call last):
  File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/test/test_asyncio/test_events.py", line 2277, in test_sendfile_ssl_pre_and_post_data
    srv_proto, cli_proto = self.prepare(is_ssl=True)
  File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/test/test_asyncio/test_events.py", line 2136, in prepare
    srv_ctx = test_utils.simple_server_sslcontext()
  File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/test/test_asyncio/utils.py", line 73, in simple_server_sslcontext
    server_context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
AttributeError: 'NoneType' object has no attribute 'SSLContext'

======================================================================
ERROR: test_sendfile_ssl (test.test_asyncio.test_events.PollEventLoopTests)
----------------------------------------------------------------------

Traceback (most recent call last):
  File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/test/test_asyncio/test_events.py", line 2243, in test_sendfile_ssl
    srv_proto, cli_proto = self.prepare(is_ssl=True)
  File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/test/test_asyncio/test_events.py", line 2136, in prepare
    srv_ctx = test_utils.simple_server_sslcontext()
  File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/test/test_asyncio/utils.py", line 73, in simple_server_sslcontext
    server_context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
AttributeError: 'NoneType' object has no attribute 'SSLContext'

======================================================================
ERROR: test_sendfile_ssl_close_peer_after_receiving (test.test_asyncio.test_events.PollEventLoopTests)
----------------------------------------------------------------------

Traceback (most recent call last):
  File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/test/test_asyncio/test_events.py", line 2325, in test_sendfile_ssl_close_peer_after_receiving
    close_after=len(self.DATA))
  File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/test/test_asyncio/test_events.py", line 2136, in prepare
    srv_ctx = test_utils.simple_server_sslcontext()
  File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/test/test_asyncio/utils.py", line 73, in simple_server_sslcontext
    server_context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
AttributeError: 'NoneType' object has no attribute 'SSLContext'

======================================================================
ERROR: test_sendfile_ssl_partial (test.test_asyncio.test_events.PollEventLoopTests)
----------------------------------------------------------------------

Traceback (most recent call last):
  File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/test/test_asyncio/test_events.py", line 2302, in test_sendfile_ssl_partial
    srv_proto, cli_proto = self.prepare(is_ssl=True)
  File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/test/test_asyncio/test_events.py", line 2136, in prepare
    srv_ctx = test_utils.simple_server_sslcontext()
  File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/test/test_asyncio/utils.py", line 73, in simple_server_sslcontext
    server_context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
AttributeError: 'NoneType' object has no attribute 'SSLContext'

======================================================================
ERROR: test_sendfile_ssl_pre_and_post_data (test.test_asyncio.test_events.PollEventLoopTests)
----------------------------------------------------------------------

Traceback (most recent call last):
  File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/test/test_asyncio/test_events.py", line 2277, in test_sendfile_ssl_pre_and_post_data
    srv_proto, cli_proto = self.prepare(is_ssl=True)
  File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/test/test_asyncio/test_events.py", line 2136, in prepare
    srv_ctx = test_utils.simple_server_sslcontext()
  File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/test/test_asyncio/utils.py", line 73, in simple_server_sslcontext
    server_context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
AttributeError: 'NoneType' object has no attribute 'SSLContext'

======================================================================
ERROR: test_sendfile_ssl (test.test_asyncio.test_events.SelectEventLoopTests)
----------------------------------------------------------------------

Traceback (most recent call last):
  File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/test/test_asyncio/test_events.py", line 2243, in test_sendfile_ssl
    srv_proto, cli_proto = self.prepare(is_ssl=True)
  File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/test/test_asyncio/test_events.py", line 2136, in prepare
    srv_ctx = test_utils.simple_server_sslcontext()
  File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/test/test_asyncio/utils.py", line 73, in simple_server_sslcontext
    server_context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
AttributeError: 'NoneType' object has no attribute 'SSLContext'

======================================================================
ERROR: test_sendfile_ssl_close_peer_after_receiving (test.test_asyncio.test_events.SelectEventLoopTests)
----------------------------------------------------------------------

Traceback (most recent call last):
  File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/test/test_asyncio/test_events.py", line 2325, in test_sendfile_ssl_close_peer_after_receiving
    close_after=len(self.DATA))
  File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/test/test_asyncio/test_events.py", line 2136, in prepare
    srv_ctx = test_utils.simple_server_sslcontext()
  File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/test/test_asyncio/utils.py", line 73, in simple_server_sslcontext
    server_context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
AttributeError: 'NoneType' object has no attribute 'SSLContext'

======================================================================
ERROR: test_sendfile_ssl_partial (test.test_asyncio.test_events.SelectEventLoopTests)
----------------------------------------------------------------------

Traceback (most recent call last):
  File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/test/test_asyncio/test_events.py", line 2302, in test_sendfile_ssl_partial
    srv_proto, cli_proto = self.prepare(is_ssl=True)
  File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/test/test_asyncio/test_events.py", line 2136, in prepare
    srv_ctx = test_utils.simple_server_sslcontext()
  File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/test/test_asyncio/utils.py", line 73, in simple_server_sslcontext
    server_context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
AttributeError: 'NoneType' object has no attribute 'SSLContext'

======================================================================
ERROR: test_sendfile_ssl_pre_and_post_data (test.test_asyncio.test_events.SelectEventLoopTests)
----------------------------------------------------------------------

Traceback (most recent call last):
  File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/test/test_asyncio/test_events.py", line 2277, in test_sendfile_ssl_pre_and_post_data
    srv_proto, cli_proto = self.prepare(is_ssl=True)
  File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/test/test_asyncio/test_events.py", line 2136, in prepare
    srv_ctx = test_utils.simple_server_sslcontext()
  File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/test/test_asyncio/utils.py", line 73, in simple_server_sslcontext
    server_context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
AttributeError: 'NoneType' object has no attribute 'SSLContext'

@vstinner
Copy link
Member Author

Similar errors on more recent macOS version, x86-64 El Capitan 3.x:

http://buildbot.python.org/all/#/builders/93/builds/234

One example:

======================================================================
ERROR: test_sendfile_ssl_partial (test.test_asyncio.test_events.SelectEventLoopTests)
----------------------------------------------------------------------

Traceback (most recent call last):
  File "/Users/buildbot/buildarea/3.x.billenstein-elcapitan/build/Lib/test/test_asyncio/test_events.py", line 2302, in test_sendfile_ssl_partial
    srv_proto, cli_proto = self.prepare(is_ssl=True)
  File "/Users/buildbot/buildarea/3.x.billenstein-elcapitan/build/Lib/test/test_asyncio/test_events.py", line 2136, in prepare
    srv_ctx = test_utils.simple_server_sslcontext()
  File "/Users/buildbot/buildarea/3.x.billenstein-elcapitan/build/Lib/test/test_asyncio/utils.py", line 73, in simple_server_sslcontext
    server_context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
AttributeError: 'NoneType' object has no attribute 'SSLContext'

@vstinner
Copy link
Member Author

And x86 Ubuntu Shared 3.x:

http://buildbot.python.org/all/#/builders/88/builds/603

Example:

======================================================================
ERROR: test_sendfile_ssl_partial (test.test_asyncio.test_events.SelectEventLoopTests)
----------------------------------------------------------------------

Traceback (most recent call last):
  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/test_asyncio/test_events.py", line 2302, in test_sendfile_ssl_partial
    srv_proto, cli_proto = self.prepare(is_ssl=True)
  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/test_asyncio/test_events.py", line 2136, in prepare
    srv_ctx = test_utils.simple_server_sslcontext()
  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/test_asyncio/utils.py", line 73, in simple_server_sslcontext
    server_context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
AttributeError: 'NoneType' object has no attribute 'SSLContext'

@vstinner
Copy link
Member Author

Oh wait, sendfile test errors come from bpo-32622, loop.sendfile().

@asvetlov
Copy link
Contributor

Should be fixed by 0f54e00e963

@vstinner
Copy link
Member Author

Oh sorry, I was reading old issues. I checked the latest status of buildbot workers for which I reported failures:

Ok, it seems like all issues now have been fixed.

On bpo-20104 will be fixed, if test_asyncio still fails on x86 Tiger 3.x, I will open a more specific issue.

I close this issue.

@asvetlov
Copy link
Contributor

Thanks, Victor!

@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 (EOL) end of life OS-windows tests Tests in the Lib/test dir topic-asyncio
Projects
None yet
Development

No branches or pull requests

4 participants