classification
Title: test_asyncio: sendfile tests fail on AMD64 Debian root 3.7 when _ssl is missing
Type: Stage: resolved
Components: Tests Versions: Python 3.9, Python 3.8, Python 3.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: christian.heimes Nosy List: asvetlov, christian.heimes, miss-islington, pablogsal, vstinner
Priority: normal Keywords: patch

Created on 2019-12-09 13:33 by vstinner, last changed 2019-12-09 14:20 by miss-islington. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 17524 merged vstinner, 2019-12-09 13:41
PR 17527 merged miss-islington, 2019-12-09 14:02
PR 17528 merged miss-islington, 2019-12-09 14:02
Messages (10)
msg358079 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-12-09 13:33
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'
msg358080 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-12-09 13:34
"""
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?
msg358081 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2019-12-09 13:36
I don't see test_ssl.py in the logs. test_unix_events.py is failing because it is missing a check for _ssl.
msg358082 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-12-09 13:43
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
msg358085 - (view) Author: Andrew Svetlov (asvetlov) * (Python committer) Date: 2019-12-09 13:47
Sorry, my fault.
msg358088 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2019-12-09 13:53
The problem was introduced by https://bugs.python.org/issue37404. I created https://github.com/python/cpython/pull/17526 to fix the problem and address a minor performance regression.
msg358090 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-12-09 14:02
New changeset 82b4950b5e92bec343a436b3f9c116400b66e1b9 by Victor Stinner in branch 'master':
bpo-39006: Fix asyncio when the ssl module is missing (GH-17524)
https://github.com/python/cpython/commit/82b4950b5e92bec343a436b3f9c116400b66e1b9
msg358091 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-12-09 14:04
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.
msg358099 - (view) Author: miss-islington (miss-islington) Date: 2019-12-09 14:19
New changeset b22183f2738e0e6c23f8c5fb5b232768c184ec96 by Miss Islington (bot) in branch '3.8':
bpo-39006: Fix asyncio when the ssl module is missing (GH-17524)
https://github.com/python/cpython/commit/b22183f2738e0e6c23f8c5fb5b232768c184ec96
msg358100 - (view) Author: miss-islington (miss-islington) Date: 2019-12-09 14:20
New changeset a0078d9a3335a5e99afe97590fdcb8e2f526ed7b by Miss Islington (bot) in branch '3.7':
bpo-39006: Fix asyncio when the ssl module is missing (GH-17524)
https://github.com/python/cpython/commit/a0078d9a3335a5e99afe97590fdcb8e2f526ed7b
History
Date User Action Args
2019-12-09 14:20:31miss-islingtonsetmessages: + msg358100
2019-12-09 14:19:52miss-islingtonsetnosy: + miss-islington
messages: + msg358099
2019-12-09 14:04:23vstinnersetstatus: open -> closed
resolution: fixed
messages: + msg358091

stage: patch review -> resolved
2019-12-09 14:02:22miss-islingtonsetpull_requests: + pull_request17006
2019-12-09 14:02:15miss-islingtonsetpull_requests: + pull_request17005
2019-12-09 14:02:08vstinnersetmessages: + msg358090
2019-12-09 13:53:13christian.heimessetmessages: + msg358088
2019-12-09 13:47:40asvetlovsetnosy: + asvetlov
messages: + msg358085
2019-12-09 13:43:14vstinnersetmessages: + msg358082
versions: + Python 3.8, Python 3.9
2019-12-09 13:41:57vstinnersetkeywords: + patch
stage: patch review
pull_requests: + pull_request17002
2019-12-09 13:36:10christian.heimessetnosy: + christian.heimes
messages: + msg358081
2019-12-09 13:35:02vstinnersetnosy: - christian.heimes

components: - SSL
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
2019-12-09 13:34:30vstinnersetmessages: + msg358080
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
2019-12-09 13:33:26vstinnercreate