Betamax fixture unit tests failures with urllib3 2.x

Bug #2072481 reported by Thomas Goirand
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
keystoneauth
New
Undecided
Unassigned

Bug Description

Hi,

Building keystoneauth1 under Debian Sid fails because of the latest version of urllib3 2.0.7 over there. Here's the unit test failure log. Please help me fix this.

======================================================================
FAIL: keystoneauth1.tests.unit.test_betamax_fixture.TestBetamaxFixture.test_keystoneauth_betamax_fixture
keystoneauth1.tests.unit.test_betamax_fixture.TestBetamaxFixture.test_keystoneauth_betamax_fixture
----------------------------------------------------------------------
testtools.testresult.real._StringException: Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/urllib3/response.py", line 710, in _error_catcher
    yield
  File "/usr/lib/python3/dist-packages/urllib3/response.py", line 835, in _raw_read
    raise IncompleteRead(self._fp_bytes_read, self.length_remaining)
urllib3.exceptions.IncompleteRead: IncompleteRead(780 bytes read, 1904 more expected)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/requests/models.py", line 820, in generate
    yield from self.raw.stream(chunk_size, decode_content=True)
  File "/usr/lib/python3/dist-packages/urllib3/response.py", line 936, in stream
    data = self.read(amt=amt, decode_content=decode_content)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/urllib3/response.py", line 907, in read
    data = self._raw_read(amt)
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/urllib3/response.py", line 813, in _raw_read
    with self._error_catcher():
  File "/usr/lib/python3.11/contextlib.py", line 158, in __exit__
    self.gen.throw(typ, value, traceback)
  File "/usr/lib/python3/dist-packages/urllib3/response.py", line 727, in _error_catcher
    raise ProtocolError(f"Connection broken: {e!r}", e) from e
urllib3.exceptions.ProtocolError: ('Connection broken: IncompleteRead(780 bytes read, 1904 more expected)', IncompleteRead(780 bytes read, 1904 more expected))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/<<PKGBUILDDIR>>/keystoneauth1/session.py", line 1021, in _send_request
    resp = self.session.request(method, url, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 589, in request
    resp = self.send(prep, **send_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 746, in send
    r.content
  File "/usr/lib/python3/dist-packages/requests/models.py", line 902, in content
    self._content = b"".join(self.iter_content(CONTENT_CHUNK_SIZE)) or b""
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/requests/models.py", line 822, in generate
    raise ChunkedEncodingError(e)
requests.exceptions.ChunkedEncodingError: ('Connection broken: IncompleteRead(780 bytes read, 1904 more expected)', IncompleteRead(780 bytes read, 1904 more expected))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/<<PKGBUILDDIR>>/keystoneauth1/tests/unit/test_betamax_fixture.py", line 54, in test_keystoneauth_betamax_fixture
    self._replay_cassette()
  File "/<<PKGBUILDDIR>>/keystoneauth1/tests/unit/test_betamax_fixture.py", line 51, in _replay_cassette
    s.get_token(auth=plugin)
  File "/<<PKGBUILDDIR>>/keystoneauth1/session.py", line 1236, in get_token
    return (self.get_auth_headers(auth) or {}).get('X-Auth-Token')
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/<<PKGBUILDDIR>>/keystoneauth1/session.py", line 1214, in get_auth_headers
    return auth.get_headers(self, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/<<PKGBUILDDIR>>/keystoneauth1/plugin.py", line 106, in get_headers
    token = self.get_token(session)
            ^^^^^^^^^^^^^^^^^^^^^^^
  File "/<<PKGBUILDDIR>>/keystoneauth1/identity/base.py", line 85, in get_token
    return self.get_access(session).auth_token
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/<<PKGBUILDDIR>>/keystoneauth1/identity/base.py", line 131, in get_access
    self.auth_ref = self.get_auth_ref(session)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/<<PKGBUILDDIR>>/keystoneauth1/identity/v2.py", line 59, in get_auth_ref
    resp = session.post(url, json=params, headers=headers,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/<<PKGBUILDDIR>>/keystoneauth1/session.py", line 1162, in post
    return self.request(url, 'POST', **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/<<PKGBUILDDIR>>/keystoneauth1/session.py", line 930, in request
    resp = send(**kwargs)
           ^^^^^^^^^^^^^^
  File "/<<PKGBUILDDIR>>/keystoneauth1/session.py", line 1041, in _send_request
    raise exceptions.UnknownConnectionError(msg, e)
keystoneauth1.exceptions.connection.UnknownConnectionError: Unexpected exception for http://keystoneauth-betamax.test/v2.0/tokens: ('Connection broken: IncompleteRead(780 bytes read, 1904 more expected)', IncompleteRead(780 bytes read, 1904 more expected))

----------------------------------------------------------------------
Ran 676 tests in 7.353s

FAILED (failures=1)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.