cdent / gabbi

Declarative HTTP Testing for Python and anything else
http://gabbi.readthedocs.org/
Other
148 stars 34 forks source link

tox is failing on master with recent pythons #320

Closed cdent closed 1 year ago

cdent commented 1 year ago

Both in CI and locally tox runs are failing. The errors change depending on python version:

3.8

gabbi.tests.test_intercept.contenttype_post_content-type.test_request
---------------------------------------------------------------------

Captured traceback:
~~~~~~~~~~~~~~~~~~~
    Traceback (most recent call last):

      File "/mnt/share/cdentsrc/gabbi/.tox/py38/lib/python3.8/site-packages/urllib3/connection.py", line 174, in _new_conn
    conn = connection.create_connection(

      File "/mnt/share/cdentsrc/gabbi/.tox/py38/lib/python3.8/site-packages/urllib3/util/connection.py", line 72, in create_connection
    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):

      File "/usr/lib/python3.8/socket.py", line 918, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):

    socket.gaierror: [Errno -2] Name or service not known

During handling of the above exception, another exception occurred:

    Traceback (most recent call last):

      File "/mnt/share/cdentsrc/gabbi/gabbi/suitemaker.py", line 104, in do_test
    return test_method(*args, **kwargs)

      File "/mnt/share/cdentsrc/gabbi/gabbi/case.py", line 97, in wrapper
    func(self)

      File "/mnt/share/cdentsrc/gabbi/gabbi/case.py", line 164, in test_request
    self._run_test()

      File "/mnt/share/cdentsrc/gabbi/gabbi/case.py", line 599, in _run_test
    self._run_request(full_url, method, headers, body,

      File "/mnt/share/cdentsrc/gabbi/gabbi/case.py", line 498, in _run_request
    response, content = self.http.request(

      File "/mnt/share/cdentsrc/gabbi/gabbi/httpclient.py", line 43, in request
    response = super(Http, self).request(

      File "/mnt/share/cdentsrc/gabbi/.tox/py38/lib/python3.8/site-packages/urllib3/request.py", line 78, in request
    return self.request_encode_body(

      File "/mnt/share/cdentsrc/gabbi/.tox/py38/lib/python3.8/site-packages/urllib3/request.py", line 170, in request_encode_body
    return self.urlopen(method, url, **extra_kw)

      File "/mnt/share/cdentsrc/gabbi/.tox/py38/lib/python3.8/site-packages/urllib3/poolmanager.py", line 376, in urlopen
    response = conn.urlopen(method, u.request_uri, **kw)

      File "/mnt/share/cdentsrc/gabbi/.tox/py38/lib/python3.8/site-packages/urllib3/connectionpool.py", line 787, in urlopen
    retries = retries.increment(

      File "/mnt/share/cdentsrc/gabbi/.tox/py38/lib/python3.8/site-packages/urllib3/util/retry.py", line 525, in increment
    raise six.reraise(type(error), error, _stacktrace)

      File "/mnt/share/cdentsrc/gabbi/.tox/py38/lib/python3.8/site-packages/urllib3/packages/six.py", line 770, in reraise
    raise value

      File "/mnt/share/cdentsrc/gabbi/.tox/py38/lib/python3.8/site-packages/urllib3/connectionpool.py", line 703, in urlopen
    httplib_response = self._make_request(

      File "/mnt/share/cdentsrc/gabbi/.tox/py38/lib/python3.8/site-packages/urllib3/connectionpool.py", line 398, in _make_request
    conn.request(method, url, **httplib_request_kw)

      File "/mnt/share/cdentsrc/gabbi/.tox/py38/lib/python3.8/site-packages/urllib3/connection.py", line 239, in request
    super(HTTPConnection, self).request(method, url, body=body, headers=headers)

      File "/usr/lib/python3.8/http/client.py", line 1256, in request
    self._send_request(method, url, body, headers, encode_chunked)

      File "/usr/lib/python3.8/http/client.py", line 1302, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)

      File "/usr/lib/python3.8/http/client.py", line 1251, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)

      File "/usr/lib/python3.8/http/client.py", line 1011, in _send_output
    self.send(msg)

      File "/usr/lib/python3.8/http/client.py", line 951, in send
    self.connect()

      File "/mnt/share/cdentsrc/gabbi/.tox/py38/lib/python3.8/site-packages/urllib3/connection.py", line 205, in connect
    conn = self._new_conn()

      File "/mnt/share/cdentsrc/gabbi/.tox/py38/lib/python3.8/site-packages/urllib3/connection.py", line 186, in _new_conn
    raise NewConnectionError(

    urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7f1c533507c0>: Failed to establish a new connection: [Errno -2] Name or service not known
gabbi.tests.test_intercept.data_json_value_from_disk.test_request
-----------------------------------------------------------------

Captured traceback:
~~~~~~~~~~~~~~~~~~~
    Traceback (most recent call last):

      File "/Users/cdent/src/gabbi/.tox/py310/lib/python3.10/site-packages/urllib3/connection.py", line 174, in _new_conn
    conn = connection.create_connection(

      File "/Users/cdent/src/gabbi/.tox/py310/lib/python3.10/site-packages/urllib3/util/connection.py", line 72, in create_connection
    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):

      File "/opt/homebrew/Cellar/python@3.10/3.10.6_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/socket.py", line 955, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):

    socket.gaierror: [Errno 8] nodename nor servname provided, or not known

During handling of the above exception, another exception occurred:

    Traceback (most recent call last):

      File "/Users/cdent/src/gabbi/gabbi/suitemaker.py", line 97, in do_test
    return test_method(*args, **kwargs)

      File "/Users/cdent/src/gabbi/gabbi/case.py", line 88, in wrapper
    func(self)

      File "/Users/cdent/src/gabbi/gabbi/case.py", line 150, in test_request
    self._run_test()

      File "/Users/cdent/src/gabbi/gabbi/case.py", line 555, in _run_test
    self._run_request(full_url, method, headers, body,

      File "/Users/cdent/src/gabbi/gabbi/case.py", line 460, in _run_request
    response, content = self.http.request(

      File "/Users/cdent/src/gabbi/gabbi/httpclient.py", line 43, in request
    response = super(Http, self).request(

      File "/Users/cdent/src/gabbi/.tox/py310/lib/python3.10/site-packages/urllib3/request.py", line 78, in request
    return self.request_encode_body(

      File "/Users/cdent/src/gabbi/.tox/py310/lib/python3.10/site-packages/urllib3/request.py", line 170, in request_encode_body
    return self.urlopen(method, url, **extra_kw)

      File "/Users/cdent/src/gabbi/.tox/py310/lib/python3.10/site-packages/urllib3/poolmanager.py", line 376, in urlopen
    response = conn.urlopen(method, u.request_uri, **kw)

      File "/Users/cdent/src/gabbi/.tox/py310/lib/python3.10/site-packages/urllib3/connectionpool.py", line 787, in urlopen
    retries = retries.increment(

      File "/Users/cdent/src/gabbi/.tox/py310/lib/python3.10/site-packages/urllib3/util/retry.py", line 525, in increment
    raise six.reraise(type(error), error, _stacktrace)

      File "/Users/cdent/src/gabbi/.tox/py310/lib/python3.10/site-packages/urllib3/packages/six.py", line 770, in reraise
    raise value

      File "/Users/cdent/src/gabbi/.tox/py310/lib/python3.10/site-packages/urllib3/connectionpool.py", line 703, in urlopen
    httplib_response = self._make_request(

      File "/Users/cdent/src/gabbi/.tox/py310/lib/python3.10/site-packages/urllib3/connectionpool.py", line 398, in _make_request
    conn.request(method, url, **httplib_request_kw)

      File "/Users/cdent/src/gabbi/.tox/py310/lib/python3.10/site-packages/urllib3/connection.py", line 239, in request
    super(HTTPConnection, self).request(method, url, body=body, headers=headers)

      File "/opt/homebrew/Cellar/python@3.10/3.10.6_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1282, in request
    self._send_request(method, url, body, headers, encode_chunked)

      File "/opt/homebrew/Cellar/python@3.10/3.10.6_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1328, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)

      File "/opt/homebrew/Cellar/python@3.10/3.10.6_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1277, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)

      File "/opt/homebrew/Cellar/python@3.10/3.10.6_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1037, in _send_output
    self.send(msg)

      File "/opt/homebrew/Cellar/python@3.10/3.10.6_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 975, in send
    self.connect()

      File "/Users/cdent/src/gabbi/.tox/py310/lib/python3.10/site-packages/urllib3/connection.py", line 205, in connect
    conn = self._new_conn()

      File "/Users/cdent/src/gabbi/.tox/py310/lib/python3.10/site-packages/urllib3/connection.py", line 186, in _new_conn
    raise NewConnectionError(

    urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x1034b14e0>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known

This is going to require some deeper investigation to determine if this is because of a library (e.g., urllib3) or python change.

cdent commented 1 year ago

Oddly when running with pytest instead of stestr/unittest, things pass... still digging

cdent commented 1 year ago

it's stestr. Setting stestr<4.0.0 gets things passing. Looking into what has changed on stestr.

cdent commented 1 year ago

https://github.com/mtreinish/stestr/pull/331 may be the cause, a revert is being tried (discussions are happening in the #stestr channel in OFTC IRC).

cdent commented 1 year ago

new version of stestr that fixes it will be released soon

mtreinish commented 1 year ago

stestr 4.0.1 which was just released should fix this: https://pypi.org/project/stestr/4.0.1/