-
Notifications
You must be signed in to change notification settings - Fork 31
https.txt tests fail #375
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
Comments
This error is tripping again on CI, coming from #397, see [1]. [1] https://github.com/crate/crate-python/runs/2115670144?check_suite_focus=true#step:5:156 |
On my machine, when running Just to share an observation about this. When running the sys:1: ResourceWarning: unclosed <socket.socket fd=4, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 65534)> Others are observing the same thing when HTTP requests are issued within a unittest environment, see [1,2]. I tried different countermeasures but haven't been able to resolve it. [1] https://stackoverflow.com/questions/48160728/resourcewarning-unclosed-socket-in-python-3-unit-test |
While I tried to get hold of this nasty error on behalf of #397, I still haven't been able to resolve it. @mfussenegger told me that #157 might be able to resolve it. Nevertheless, I am inclined to skip the relevant single test within cc @seut |
I improved the test cases within Setupdocker run -it --rm python:3.9.2 bash
python3 -m venv .venv
source .venv/bin/activate
# Workaround for Python 3.9
python -m pip install --upgrade "setuptools>=31,<51"
pip install zc.buildout==2.13.4
buildout -n Invoke./bin/test -vvvv --ignore_dir=testing --buffer
Running tests at level 1
Running zope.testrunner.layer.UnitTests tests:
Set up zope.testrunner.layer.UnitTests in 0.000 seconds.
Running:
/src/src/crate/client/doctests/cursor.txt (0.006 s)
/src/src/crate/client/doctests/connection.txt (0.003 s)
Ran 2 tests with 0 failures, 0 errors, 0 skipped in 0.009 seconds.
Running crate.client.tests.httpsserver tests:
Tear down zope.testrunner.layer.UnitTests in 0.000 seconds.
Set up crate.client.tests.httpsserver listening on localhost 65534
in 0.504 seconds.
Running:
/src/src/crate/client/doctests/https.txt OutcomeAfter 150s of execution time, the response is: ----------------------------------------------------------------------
File "/src/src/crate/client/doctests/https.txt", line 93, in https.txt
Failed example:
client.server_infos(crate_host)
Expected:
Traceback (most recent call last):
...
crate.client.exceptions.ConnectionError: Server not available, exception: ...[SSL: ...
Got:
Traceback (most recent call last):
File "/usr/local/lib/python3.9/doctest.py", line 1336, in __run
exec(compile(example.source, filename, "single",
File "<doctest https.txt[13]>", line 1, in <module>
client.server_infos(crate_host)
File "/src/src/crate/client/http.py", line 402, in server_infos
response = self._request('GET', '/', server=server)
File "/src/src/crate/client/http.py", line 501, in _request
raise ConnectionError(
crate.client.exceptions.ConnectionError: Server not available, exception: HTTPSConnectionPool(host='localhost', port=65534): Max retries exceeded with url: / (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x7ff5ca50e1c0>, 'Connection to localhost timed out. (connect timeout=5)')) ----------------------------------------------------------------------
File "/src/src/crate/client/doctests/https.txt", line 101, in https.txt
Failed example:
client.server_infos(crate_host)
Expected:
Traceback (most recent call last):
...
crate.client.exceptions.ConnectionError: Server not available, exception: ...[SSL: ...
Got:
Traceback (most recent call last):
File "/usr/local/lib/python3.9/doctest.py", line 1336, in __run
exec(compile(example.source, filename, "single",
File "<doctest https.txt[15]>", line 1, in <module>
client.server_infos(crate_host)
File "/src/src/crate/client/http.py", line 402, in server_infos
response = self._request('GET', '/', server=server)
File "/src/src/crate/client/http.py", line 501, in _request
raise ConnectionError(
crate.client.exceptions.ConnectionError: Server not available, exception: HTTPSConnectionPool(host='localhost', port=65534): Max retries exceeded with url: / (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x7ff5ca49c2b0>, 'Connection to localhost timed out. (connect timeout=5)')) EvaluationSo, it looks like that, on Linux, dialing to an SSL-enabled host with invalid client certificate configuration, will stall the SSL handshake in one way or another. At least, we observe this behavior when connecting to Python's |
I have been able to narrow this down to this single test where an invalid CA key/cert file is used to emulate an invalid client certificate.
When removing this single test, the whole suite within |
Instead of an SSL exception the test fails when trying to establish a connection
The text was updated successfully, but these errors were encountered: