cherrypy / cheroot

Cheroot is the high-performance, pure-Python HTTP server used by CherryPy. Docs -->
https://cheroot.cherrypy.dev
BSD 3-Clause "New" or "Revised" License
184 stars 90 forks source link

test_http_over_https_error failing on macOS #225

Open jaraco opened 4 years ago

jaraco commented 4 years ago

Attempting to cut the 6.6 release, the release was blocked due to test failures in macOS seen in this build. When I run the tests locally, those tests pass, but different tests fail.

webknjaz commented 4 years ago

Yeah, just skip that for now. It's quite tricky to catch all combos of OS x Python x OpenSSL/LibreSSL, most of the cases produce different results, especially under macOS.

webknjaz commented 4 years ago

Also, the upload failed because #214 (I think). At least, the log reports HTTPError: 403 Client Error: Invalid or non-existent authentication information. for url: https://upload.pypi.org/legacy/. I assume that it still hits the old secret from .travis.yml and you probably changed your password after supplying token, right?

jaraco commented 4 years ago

I haven't changed my password. I expected the upload to work. Today I manually uploaded the release (after working around several other obstacles). I've opened #226 to clear one of those obstacles.

jaraco commented 4 years ago

moving the other failure to #237

jaraco commented 4 years ago

The tests that fail are: test_http_over_https_error[0.0.0.0-builtin] and test_http_over_https_error[::-builtin].

jaraco commented 4 years ago

In 7c68694, I mark those test (variants) as xfail so at least they shouldn't block releases any longer. I'll leave it as an exercise for someone else to trace the actual issue and address it properly.

jaraco commented 4 years ago

After committing that workaround, the tests are now failing on macOS on my local workstation.

``` python develop-inst-noop: /Users/jaraco/code/public/cherrypy/cheroot python installed: apipkg==1.5,argh==0.26.2,asn1crypto==1.0.1,atomicwrites==1.3.0,attrs==19.2.0,certifi==2019.9.11,cffi==1.12.3,chardet==3.0.4,-e git+gh://cherrypy/cheroot@7c686947e1b5bba7d94bd1ebd11f3f8c83b04455#egg=cheroot,codecov==2.0.15,colorama==0.4.1,coverage==4.5.3,cryptography==2.7,docopt==0.6.2,execnet==1.7.1,idna==2.8,jaraco.functools==2.0,more-itertools==7.2.0,packaging==19.2,pathtools==0.1.2,pluggy==0.13.0,py==1.8.0,pycparser==2.19,pyOpenSSL==19.0.0,pyparsing==2.4.2,pytest==5.2.1,pytest-cov==2.7.1,pytest-forked==1.1.1,pytest-mock==1.10.4,pytest-sugar==0.9.2,pytest-testmon==0.9.19,pytest-watch==4.2.0,pytest-xdist==1.30.0,PyYAML==5.1.2,requests==2.22.0,requests-unixsocket==0.2.0,six==1.12.0,termcolor==1.1.0,trustme==0.5.2,urllib3==1.25.6,watchdog==0.9.0,wcwidth==0.1.7 python run-test-pre: PYTHONHASHSEED='3603278255' python run-test: commands[0] | pytest --testmon-off -k test_ssl ============================= test session starts ============================== platform darwin -- Python 3.8.0rc1, pytest-5.2.1, py-1.8.0, pluggy-0.13.0 -- /Users/jaraco/code/public/cherrypy/cheroot/.tox/python/bin/python cachedir: .tox/python/.pytest_cache rootdir: /Users/jaraco/code/public/cherrypy/cheroot, inifile: pytest.ini, testpaths: cheroot/test/ plugins: testmon-0.9.19, xdist-1.30.0, forked-1.1.1, sugar-0.9.2, cov-2.7.1, mock-1.10.4 gw0 I / gw1 I / gw2 I / gw3 I / gw4 I / gw5 I / gw6 I / gw7 I [gw0] darwin Python 3.8.0 cwd: /Users/jaraco/code/public/cherrypy/cheroot [gw1] darwin Python 3.8.0 cwd: /Users/jaraco/code/public/cherrypy/cheroot [gw2] darwin Python 3.8.0 cwd: /Users/jaraco/code/public/cherrypy/cheroot [gw3] darwin Python 3.8.0 cwd: /Users/jaraco/code/public/cherrypy/cheroot [gw4] darwin Python 3.8.0 cwd: /Users/jaraco/code/public/cherrypy/cheroot [gw5] darwin Python 3.8.0 cwd: /Users/jaraco/code/public/cherrypy/cheroot [gw6] darwin Python 3.8.0 cwd: /Users/jaraco/code/public/cherrypy/cheroot [gw7] darwin Python 3.8.0 cwd: /Users/jaraco/code/public/cherrypy/cheroot [gw0] Python 3.8.0rc1 (v3.8.0rc1:34214de6ab, Oct 1 2019, 12:56:49) -- [Clang 6.0 (clang-600.0.57)] [gw1] Python 3.8.0rc1 (v3.8.0rc1:34214de6ab, Oct 1 2019, 12:56:49) -- [Clang 6.0 (clang-600.0.57)] [gw2] Python 3.8.0rc1 (v3.8.0rc1:34214de6ab, Oct 1 2019, 12:56:49) -- [Clang 6.0 (clang-600.0.57)] [gw3] Python 3.8.0rc1 (v3.8.0rc1:34214de6ab, Oct 1 2019, 12:56:49) -- [Clang 6.0 (clang-600.0.57)] [gw4] Python 3.8.0rc1 (v3.8.0rc1:34214de6ab, Oct 1 2019, 12:56:49) -- [Clang 6.0 (clang-600.0.57)] [gw5] Python 3.8.0rc1 (v3.8.0rc1:34214de6ab, Oct 1 2019, 12:56:49) -- [Clang 6.0 (clang-600.0.57)] [gw6] Python 3.8.0rc1 (v3.8.0rc1:34214de6ab, Oct 1 2019, 12:56:49) -- [Clang 6.0 (clang-600.0.57)] [gw7] Python 3.8.0rc1 (v3.8.0rc1:34214de6ab, Oct 1 2019, 12:56:49) -- [Clang 6.0 (clang-600.0.57)] gw0 [38] / gw1 [38] / gw2 [38] / gw3 [38] / gw4 [38] / gw5 [38] / gw6 [38] / gw7 [38] scheduling tests via LoadScheduling cheroot/test/test_ssl.py::test_tls_client_auth[VerifyMode.CERT_NONE-True-localhost-builtin] cheroot/test/test_ssl.py::test_ssl_adapters[pyopenssl] cheroot/test/test_ssl.py::test_ssl_adapters[builtin] cheroot/test/test_ssl.py::test_tls_client_auth[VerifyMode.CERT_NONE-True-localhost-pyopenssl] cheroot/test/test_ssl.py::test_tls_client_auth[VerifyMode.CERT_NONE-True-127.0.0.1-builtin] cheroot/test/test_ssl.py::test_tls_client_auth[VerifyMode.CERT_NONE-True-127.0.0.1-pyopenssl] cheroot/test/test_ssl.py::test_tls_client_auth[VerifyMode.CERT_NONE-True-*.localhost-builtin] cheroot/test/test_ssl.py::test_tls_client_auth[VerifyMode.CERT_NONE-True-*.localhost-pyopenssl] [gw0] [ 2%] PASSED cheroot/test/test_ssl.py::test_ssl_adapters[builtin] [gw3] [ 5%] PASSED cheroot/test/test_ssl.py::test_tls_client_auth[VerifyMode.CERT_NONE-True-localhost-pyopenssl] cheroot/test/test_ssl.py::test_tls_client_auth[VerifyMode.CERT_NONE-True-not_localhost-builtin] cheroot/test/test_ssl.py::test_tls_client_auth[VerifyMode.CERT_NONE-False-localhost-pyopenssl] [gw6] [ 7%] PASSED cheroot/test/test_ssl.py::test_tls_client_auth[VerifyMode.CERT_NONE-True-*.localhost-builtin] cheroot/test/test_ssl.py::test_tls_client_auth[VerifyMode.CERT_OPTIONAL-True-127.0.0.1-builtin] [gw1] [ 10%] PASSED cheroot/test/test_ssl.py::test_ssl_adapters[pyopenssl] cheroot/test/test_ssl.py::test_tls_client_auth[VerifyMode.CERT_NONE-True-not_localhost-pyopenssl] [gw2] [ 13%] PASSED cheroot/test/test_ssl.py::test_tls_client_auth[VerifyMode.CERT_NONE-True-localhost-builtin] cheroot/test/test_ssl.py::test_tls_client_auth[VerifyMode.CERT_NONE-False-localhost-builtin] [gw4] [ 15%] PASSED cheroot/test/test_ssl.py::test_tls_client_auth[VerifyMode.CERT_NONE-True-127.0.0.1-builtin] cheroot/test/test_ssl.py::test_tls_client_auth[VerifyMode.CERT_OPTIONAL-True-localhost-builtin] [gw5] [ 18%] PASSED cheroot/test/test_ssl.py::test_tls_client_auth[VerifyMode.CERT_NONE-True-127.0.0.1-pyopenssl] cheroot/test/test_ssl.py::test_tls_client_auth[VerifyMode.CERT_OPTIONAL-True-localhost-pyopenssl] [gw0] [ 21%] PASSED cheroot/test/test_ssl.py::test_tls_client_auth[VerifyMode.CERT_NONE-True-not_localhost-builtin] cheroot/test/test_ssl.py::test_tls_client_auth[VerifyMode.CERT_OPTIONAL-True-*.localhost-builtin] [gw7] [ 23%] PASSED cheroot/test/test_ssl.py::test_tls_client_auth[VerifyMode.CERT_NONE-True-*.localhost-pyopenssl] cheroot/test/test_ssl.py::test_tls_client_auth[VerifyMode.CERT_OPTIONAL-True-127.0.0.1-pyopenssl] [gw1] [ 26%] PASSED cheroot/test/test_ssl.py::test_tls_client_auth[VerifyMode.CERT_NONE-True-not_localhost-pyopenssl] cheroot/test/test_ssl.py::test_tls_client_auth[VerifyMode.CERT_OPTIONAL-True-not_localhost-pyopenssl] [gw6] [ 28%] PASSED cheroot/test/test_ssl.py::test_tls_client_auth[VerifyMode.CERT_OPTIONAL-True-127.0.0.1-builtin] cheroot/test/test_ssl.py::test_tls_client_auth[VerifyMode.CERT_OPTIONAL-True-not_localhost-builtin] [gw2] [ 31%] PASSED cheroot/test/test_ssl.py::test_tls_client_auth[VerifyMode.CERT_NONE-False-localhost-builtin] cheroot/test/test_ssl.py::test_tls_client_auth[VerifyMode.CERT_OPTIONAL-False-localhost-builtin] [gw4] [ 34%] PASSED cheroot/test/test_ssl.py::test_tls_client_auth[VerifyMode.CERT_OPTIONAL-True-localhost-builtin] cheroot/test/test_ssl.py::test_tls_client_auth[VerifyMode.CERT_OPTIONAL-False-localhost-pyopenssl] [gw3] [ 36%] PASSED cheroot/test/test_ssl.py::test_tls_client_auth[VerifyMode.CERT_NONE-False-localhost-pyopenssl] cheroot/test/test_ssl.py::test_tls_client_auth[VerifyMode.CERT_OPTIONAL-True-*.localhost-pyopenssl] [gw7] [ 39%] PASSED cheroot/test/test_ssl.py::test_tls_client_auth[VerifyMode.CERT_OPTIONAL-True-127.0.0.1-pyopenssl] cheroot/test/test_ssl.py::test_tls_client_auth[VerifyMode.CERT_REQUIRED-True-127.0.0.1-builtin] [gw0] [ 42%] PASSED cheroot/test/test_ssl.py::test_tls_client_auth[VerifyMode.CERT_OPTIONAL-True-*.localhost-builtin] cheroot/test/test_ssl.py::test_tls_client_auth[VerifyMode.CERT_REQUIRED-True-localhost-pyopenssl] [gw1] [ 44%] PASSED cheroot/test/test_ssl.py::test_tls_client_auth[VerifyMode.CERT_OPTIONAL-True-not_localhost-pyopenssl] cheroot/test/test_ssl.py::test_tls_client_auth[VerifyMode.CERT_REQUIRED-True-127.0.0.1-pyopenssl] [gw5] [ 47%] PASSED cheroot/test/test_ssl.py::test_tls_client_auth[VerifyMode.CERT_OPTIONAL-True-localhost-pyopenssl] cheroot/test/test_ssl.py::test_tls_client_auth[VerifyMode.CERT_REQUIRED-True-localhost-builtin] [gw3] [ 50%] PASSED cheroot/test/test_ssl.py::test_tls_client_auth[VerifyMode.CERT_OPTIONAL-True-*.localhost-pyopenssl] cheroot/test/test_ssl.py::test_tls_client_auth[VerifyMode.CERT_REQUIRED-True-not_localhost-pyopenssl] [gw2] [ 52%] XFAIL cheroot/test/test_ssl.py::test_tls_client_auth[VerifyMode.CERT_OPTIONAL-False-localhost-builtin] cheroot/test/test_ssl.py::test_tls_client_auth[VerifyMode.CERT_REQUIRED-True-*.localhost-pyopenssl] [gw6] [ 55%] PASSED cheroot/test/test_ssl.py::test_tls_client_auth[VerifyMode.CERT_OPTIONAL-True-not_localhost-builtin] cheroot/test/test_ssl.py::test_tls_client_auth[VerifyMode.CERT_REQUIRED-True-*.localhost-builtin] [gw4] [ 57%] PASSED cheroot/test/test_ssl.py::test_tls_client_auth[VerifyMode.CERT_OPTIONAL-False-localhost-pyopenssl] cheroot/test/test_ssl.py::test_tls_client_auth[VerifyMode.CERT_REQUIRED-True-not_localhost-builtin] [gw7] [ 60%] PASSED cheroot/test/test_ssl.py::test_tls_client_auth[VerifyMode.CERT_REQUIRED-True-127.0.0.1-builtin] cheroot/test/test_ssl.py::test_tls_client_auth[VerifyMode.CERT_REQUIRED-False-localhost-builtin] [gw0] [ 63%] PASSED cheroot/test/test_ssl.py::test_tls_client_auth[VerifyMode.CERT_REQUIRED-True-localhost-pyopenssl] cheroot/test/test_ssl.py::test_tls_client_auth[VerifyMode.CERT_REQUIRED-False-localhost-pyopenssl] [gw3] [ 65%] PASSED cheroot/test/test_ssl.py::test_tls_client_auth[VerifyMode.CERT_REQUIRED-True-not_localhost-pyopenssl] cheroot/test/test_ssl.py::test_http_over_https_error[0.0.0.0-builtin] [gw6] [ 68%] PASSED cheroot/test/test_ssl.py::test_tls_client_auth[VerifyMode.CERT_REQUIRED-True-*.localhost-builtin] cheroot/test/test_ssl.py::test_http_over_https_error[::-builtin] [gw5] [ 71%] PASSED cheroot/test/test_ssl.py::test_tls_client_auth[VerifyMode.CERT_REQUIRED-True-localhost-builtin] cheroot/test/test_ssl.py::test_https_over_http_error[::] [gw1] [ 73%] PASSED cheroot/test/test_ssl.py::test_tls_client_auth[VerifyMode.CERT_REQUIRED-True-127.0.0.1-pyopenssl] cheroot/test/test_ssl.py::test_https_over_http_error[0.0.0.0] [gw2] [ 76%] PASSED cheroot/test/test_ssl.py::test_tls_client_auth[VerifyMode.CERT_REQUIRED-True-*.localhost-pyopenssl] cheroot/test/test_ssl.py::test_http_over_https_error[0.0.0.0-pyopenssl] [gw5] [ 78%] PASSED cheroot/test/test_ssl.py::test_https_over_http_error[::] [gw3] [ 81%] XFAIL cheroot/test/test_ssl.py::test_http_over_https_error[0.0.0.0-builtin] [gw1] [ 84%] PASSED cheroot/test/test_ssl.py::test_https_over_http_error[0.0.0.0] [gw3] [ 84%] ERROR cheroot/test/test_ssl.py::test_http_over_https_error[0.0.0.0-builtin] [gw4] [ 86%] PASSED cheroot/test/test_ssl.py::test_tls_client_auth[VerifyMode.CERT_REQUIRED-True-not_localhost-builtin] cheroot/test/test_ssl.py::test_http_over_https_error[::-pyopenssl] [gw0] [ 89%] PASSED cheroot/test/test_ssl.py::test_tls_client_auth[VerifyMode.CERT_REQUIRED-False-localhost-pyopenssl] [gw2] [ 92%] PASSED cheroot/test/test_ssl.py::test_http_over_https_error[0.0.0.0-pyopenssl] [gw6] [ 94%] XFAIL cheroot/test/test_ssl.py::test_http_over_https_error[::-builtin] [gw6] [ 94%] ERROR cheroot/test/test_ssl.py::test_http_over_https_error[::-builtin] [gw7] [ 97%] XFAIL cheroot/test/test_ssl.py::test_tls_client_auth[VerifyMode.CERT_REQUIRED-False-localhost-builtin] [gw4] [100%] PASSED cheroot/test/test_ssl.py::test_http_over_https_error[::-pyopenssl] ==================================== ERRORS ==================================== _______ ERROR at teardown of test_http_over_https_error[0.0.0.0-builtin] _______ [gw3] darwin -- Python 3.8.0 /Users/jaraco/code/public/cherrypy/cheroot/.tox/python/bin/python @pytest.fixture def tls_http_server(): """Provision a server creator as a fixture.""" def start_srv(): bind_addr, ssl_adapter = yield httpserver = make_tls_http_server(bind_addr, ssl_adapter) yield httpserver yield httpserver srv_creator = iter(start_srv()) next(srv_creator) yield srv_creator try: while True: > httpserver = next(srv_creator) srv_creator = .start_srv at 0x104ebaf90> start_srv = .start_srv at 0x104ec6ca0> cheroot/test/test_ssl.py:120: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def start_srv(): > bind_addr, ssl_adapter = yield E TypeError: cannot unpack non-iterable NoneType object cheroot/test/test_ssl.py:110: TypeError _________ ERROR at teardown of test_http_over_https_error[::-builtin] __________ [gw6] darwin -- Python 3.8.0 /Users/jaraco/code/public/cherrypy/cheroot/.tox/python/bin/python @pytest.fixture def tls_http_server(): """Provision a server creator as a fixture.""" def start_srv(): bind_addr, ssl_adapter = yield httpserver = make_tls_http_server(bind_addr, ssl_adapter) yield httpserver yield httpserver srv_creator = iter(start_srv()) next(srv_creator) yield srv_creator try: while True: > httpserver = next(srv_creator) srv_creator = .start_srv at 0x1057f5f90> start_srv = .start_srv at 0x106a26b80> cheroot/test/test_ssl.py:120: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def start_srv(): > bind_addr, ssl_adapter = yield E TypeError: cannot unpack non-iterable NoneType object cheroot/test/test_ssl.py:110: TypeError - generated xml file: /Users/jaraco/code/public/cherrypy/cheroot/junit-test-results.xml - -------- coverage: platform darwin, python 3.8.0-candidate-1 --------- Name Stmts Miss Cover Missing ------------------------------------------------------------- cheroot/__init__.py 10 4 60% 8-9, 14-15 cheroot/__main__.py 3 3 0% 3-6 cheroot/_compat.py 49 19 61% 15-16, 49-77, 88, 99, 104-110 cheroot/cli.py 71 71 0% 24-234 cheroot/connections.py 143 54 62% 19-41, 92, 97-98, 102-103, 126-128, 135-136, 153-160, 168-170, 176, 182-183, 189, 200-219, 237-242, 253, 256, 264, 268, 273 cheroot/makefile.py 302 241 20% 11-13, 32, 46-47, 56-59, 62, 65-68, 72-82, 86-88, 92-95, 100-110, 116, 132-190, 194-282, 286-406, 447 cheroot/server.py 938 426 55% 80-81, 122-129, 134-137, 197, 203, 209, 213, 217-218, 224, 229, 246-247, 266, 278-281, 294-297, 322-331, 335, 339, 343-346, 375-384, 396-405, 418-427, 431, 435, 439-441, 462-467, 470-504, 519-540, 552-583, 596-605, 614-635, 639, 722-727, 734-740, 743, 774-776, 787-790, 793-796, 799-805, 811-818, 824, 826-828, 832, 840-872, 885-889, 900-906, 909-913, 917-921, 938-940, 944, 947, 970-971, 983-985, 991-996, 999-1004, 1010-1014, 1021, 1026-1034, 1057-1063, 1070, 1074-1080, 1103-1112, 1122-1124, 1139, 1151, 1157, 1169, 1175-1179, 1196, 1272, 1284-1299, 1301, 1306-1310, 1317, 1338-1346, 1376-1408, 1413-1414, 1419-1420, 1425-1426, 1436-1450, 1455-1456, 1461-1462, 1476, 1632-1635, 1639, 1676, 1687-1696, 1714, 1717-1721, 1732-1740, 1747-1751, 1754, 1771-1774, 1780-1784, 1807-1812, 1827-1908, 1930, 1953-1956, 1983-1986, 1991, 1997-1999, 2011-2013, 2031-2036, 2056-2058, 2102, 2110-2111 cheroot/ssl/builtin.py 90 29 68% 15-16, 20-24, 34-36, 43-49, 91, 103, 117-147, 163, 197 cheroot/ssl/pyopenssl.py 140 20 86% 49-52, 83, 88-91, 94, 99-100, 109, 113, 133, 141, 250, 261, 276, 343 cheroot/test/conftest.py 38 3 92% 25, 31, 40 cheroot/test/helper.py 102 64 37% 48-76, 81-82, 87-89, 94-97, 103-111, 120, 128-130, 134-141, 149-168 cheroot/test/test__compat.py 24 10 58% 23, 35-37, 42-44, 56, 61-62 cheroot/test/test_conn.py 517 462 11% 26, 30, 34-41, 45-48, 52-53, 57-58, 62-63, 67, 71-72, 76-77, 85-87, 109-120, 126, 131, 136, 145-182, 195-261, 273-334, 346-390, 395-465, 480-497, 505-591, 599-634, 639-689, 701-761, 767-799, 812-853, 863-879, 884-894, 918-930, 940-958, 971-980 cheroot/test/test_core.py 205 147 28% 30, 34-37, 41, 45-47, 56, 72-76, 82-86, 92, 97-99, 104-107, 112-117, 132-134, 153-164, 172-179, 194-199, 207-211, 216-220, 225-231, 241-247, 256-262, 291-298, 303-312, 317-328, 333-345, 352-366, 374-377, 381, 389-391, 395, 399, 405-409, 414-415 cheroot/test/test_dispatch.py 15 11 27% 12-24, 30-49 cheroot/test/test_errors.py 8 3 62% 28-30 cheroot/test/test_makefile.py 31 22 29% 14, 18-23, 27-30, 34, 39-43, 48-52 cheroot/test/test_server.py 126 83 34% 45-53, 59-64, 72-90, 95-110, 122-125, 131-133, 139-141, 150-160, 163-166, 172-175, 182-201, 213-235 cheroot/test/test_ssl.py 190 24 87% 86, 311, 335, 340, 347-353, 361, 371, 477-502 cheroot/test/webtest.py 322 235 27% 56-59, 64-66, 74-81, 96-98, 127-128, 132-136, 147-152, 161, 165, 173, 198-224, 234-242, 247-292, 297, 301-306, 314-319, 323-334, 338-347, 351-358, 362-367, 371-377, 381-388, 392-397, 401-406, 410-415, 423-452, 457-477, 489-499, 513-542, 563-566, 592-601 cheroot/testing.py 78 38 51% 38-61, 67-68, 74-75, 80-84, 87-96, 102, 111-115, 124-128, 132, 144-146, 153 cheroot/workers/threadpool.py 142 53 63% 22, 25, 113-114, 119, 129-133, 135-136, 180, 185-186, 199-204, 208-219, 222-225, 231-247, 269, 277-292, 297 cheroot/wsgi.py 162 121 25% 72-83, 92, 96, 108-111, 143-153, 159-191, 202-206, 214-239, 251-318, 332-349, 353-356, 360-364, 380-392, 409-424 ------------------------------------------------------------- TOTAL 3747 2143 43% 4 files skipped due to complete coverage. Coverage XML written to file coverage.xml ========================== slowest 10 test durations =========================== 0.42s setup cheroot/test/test_ssl.py::test_tls_client_auth[VerifyMode.CERT_NONE-True-127.0.0.1-pyopenssl] 0.42s setup cheroot/test/test_ssl.py::test_tls_client_auth[VerifyMode.CERT_REQUIRED-True-127.0.0.1-pyopenssl] 0.41s call cheroot/test/test_ssl.py::test_tls_client_auth[VerifyMode.CERT_NONE-True-*.localhost-pyopenssl] 0.39s setup cheroot/test/test_ssl.py::test_tls_client_auth[VerifyMode.CERT_REQUIRED-False-localhost-builtin] 0.37s setup cheroot/test/test_ssl.py::test_tls_client_auth[VerifyMode.CERT_OPTIONAL-True-*.localhost-builtin] 0.35s setup cheroot/test/test_ssl.py::test_http_over_https_error[::-builtin] 0.35s setup cheroot/test/test_ssl.py::test_tls_client_auth[VerifyMode.CERT_OPTIONAL-True-localhost-pyopenssl] 0.35s setup cheroot/test/test_ssl.py::test_tls_client_auth[VerifyMode.CERT_NONE-False-localhost-pyopenssl] 0.35s call cheroot/test/test_ssl.py::test_tls_client_auth[VerifyMode.CERT_NONE-False-localhost-builtin] 0.34s call cheroot/test/test_ssl.py::test_tls_client_auth[VerifyMode.CERT_OPTIONAL-False-localhost-builtin] =========================== short test summary info ============================ XFAIL cheroot/test/test_ssl.py::test_tls_client_auth[VerifyMode.CERT_OPTIONAL-False-localhost-builtin] reason: Test sometimes fails XFAIL cheroot/test/test_ssl.py::test_http_over_https_error[0.0.0.0-builtin] reason: Test fails in Travis-CI XFAIL cheroot/test/test_ssl.py::test_http_over_https_error[::-builtin] reason: Test fails in Travis-CI XFAIL cheroot/test/test_ssl.py::test_tls_client_auth[VerifyMode.CERT_REQUIRED-False-localhost-builtin] reason: Test sometimes fails ==================== 34 passed, 4 xfailed, 2 error in 4.93s ==================== Coverage.py warning: No data was collected. (no-data-collected) ERROR: InvocationError for command /Users/jaraco/code/public/cherrypy/cheroot/.tox/python/bin/pytest --testmon-off -k test_ssl (exited with code 1) ___________________________________ summary ____________________________________ ERROR: python: commands failed ```
jaraco commented 4 years ago

The problem is that this fixture fails when the fixture isn't initialized with a .send() operation:

@pytest.fixture
def tls_http_server():
    """Provision a server creator as a fixture."""
    def start_srv():
        bind_addr, ssl_adapter = yield
        httpserver = make_tls_http_server(bind_addr, ssl_adapter)
        yield httpserver
        yield httpserver

    srv_creator = iter(start_srv())
    next(srv_creator)
    yield srv_creator
    try:
        while True:
            httpserver = next(srv_creator)
            if httpserver is not None:
                httpserver.stop()
    except StopIteration:
        pass
webknjaz commented 4 years ago

Yeah, I've wanted to refactor that fixture for a long time as I gained more intel on how fixtures can be composed in pytest but never got to do it..