Page MenuHomeSoftware Heritage

Jenkins > .tox.py3.lib.python3.7.site-packages.swh.graph.tests.test_api_client::test_neighbors[simple-backend]
Failed

TEST RESULT

Run At
May 3 2021, 6:19 PM
Details
self = <urllib3.response.HTTPResponse object at 0x7f1844996630> def _update_chunk_length(self): # First, we'll figure out length of a chunk and then # we'll try to read it from socket. if self.chunk_left is not None: return line = self._fp.fp.readline() line = line.split(b";", 1)[0] try: > self.chunk_left = int(line, 16) E ValueError: invalid literal for int() with base 16: b'HTTP/1.1 500 Internal Server Error\r\n' .tox/py3/lib/python3.7/site-packages/urllib3/response.py:697: ValueError During handling of the above exception, another exception occurred: self = <urllib3.response.HTTPResponse object at 0x7f1844996630> @contextmanager def _error_catcher(self): """ Catch low-level python exceptions, instead re-raising urllib3 variants, so that low-level exceptions are not leaked in the high-level api. On exit, release the connection back to the pool. """ clean_exit = False try: try: > yield .tox/py3/lib/python3.7/site-packages/urllib3/response.py:438: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <urllib3.response.HTTPResponse object at 0x7f1844996630>, amt = 512 decode_content = True def read_chunked(self, amt=None, decode_content=None): """ Similar to :meth:`HTTPResponse.read`, but with an additional parameter: ``decode_content``. :param amt: How much of the content to read. If specified, caching is skipped because it doesn't make sense to cache partial content as the full response. :param decode_content: If True, will attempt to decode the body based on the 'content-encoding' header. """ self._init_decoder() # FIXME: Rewrite this method and make it a class with a better structured logic. if not self.chunked: raise ResponseNotChunked( "Response is not chunked. " "Header 'transfer-encoding: chunked' is missing." ) if not self.supports_chunked_reads(): raise BodyNotHttplibCompatible( "Body should be http.client.HTTPResponse like. " "It should have have an fp attribute which returns raw chunks." ) with self._error_catcher(): # Don't bother reading the body of a HEAD request. if self._original_response and is_response_to_head(self._original_response): self._original_response.close() return # If a response is already read and closed # then return immediately. if self._fp.fp is None: return while True: > self._update_chunk_length() .tox/py3/lib/python3.7/site-packages/urllib3/response.py:764: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <urllib3.response.HTTPResponse object at 0x7f1844996630> def _update_chunk_length(self): # First, we'll figure out length of a chunk and then # we'll try to read it from socket. if self.chunk_left is not None: return line = self._fp.fp.readline() line = line.split(b";", 1)[0] try: self.chunk_left = int(line, 16) except ValueError: # Invalid chunked protocol response, abort. self.close() > raise InvalidChunkLength(self, line) E urllib3.exceptions.InvalidChunkLength: InvalidChunkLength(got length b'HTTP/1.1 500 Internal Server Error\r\n', 0 bytes read) .tox/py3/lib/python3.7/site-packages/urllib3/response.py:701: InvalidChunkLength During handling of the above exception, another exception occurred: def generate(): # Special case for urllib3. if hasattr(self.raw, 'stream'): try: > for chunk in self.raw.stream(chunk_size, decode_content=True): .tox/py3/lib/python3.7/site-packages/requests/models.py:753: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <urllib3.response.HTTPResponse object at 0x7f1844996630>, amt = 512 decode_content = True def stream(self, amt=2 ** 16, decode_content=None): """ A generator wrapper for the read() method. A call will block until ``amt`` bytes have been read from the connection or until the connection is closed. :param amt: How much of the content to read. The generator will return up to much data per iteration, but may return less. This is particularly likely when using compressed data. However, the empty string will never be returned. :param decode_content: If True, will attempt to decode the body based on the 'content-encoding' header. """ if self.chunked and self.supports_chunked_reads(): > for line in self.read_chunked(amt, decode_content=decode_content): .tox/py3/lib/python3.7/site-packages/urllib3/response.py:572: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <urllib3.response.HTTPResponse object at 0x7f1844996630>, amt = 512 decode_content = True def read_chunked(self, amt=None, decode_content=None): """ Similar to :meth:`HTTPResponse.read`, but with an additional parameter: ``decode_content``. :param amt: How much of the content to read. If specified, caching is skipped because it doesn't make sense to cache partial content as the full response. :param decode_content: If True, will attempt to decode the body based on the 'content-encoding' header. """ self._init_decoder() # FIXME: Rewrite this method and make it a class with a better structured logic. if not self.chunked: raise ResponseNotChunked( "Response is not chunked. " "Header 'transfer-encoding: chunked' is missing." ) if not self.supports_chunked_reads(): raise BodyNotHttplibCompatible( "Body should be http.client.HTTPResponse like. " "It should have have an fp attribute which returns raw chunks." ) with self._error_catcher(): # Don't bother reading the body of a HEAD request. if self._original_response and is_response_to_head(self._original_response): self._original_response.close() return # If a response is already read and closed # then return immediately. if self._fp.fp is None: return while True: > self._update_chunk_length() .tox/py3/lib/python3.7/site-packages/urllib3/response.py:764: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <contextlib._GeneratorContextManager object at 0x7f1844996780> type = <class 'urllib3.exceptions.InvalidChunkLength'> value = InvalidChunkLength(got length b'HTTP/1.1 500 Internal Server Error\r\n', 0 bytes read) traceback = <traceback object at 0x7f1844950108> def __exit__(self, type, value, traceback): if type is None: try: next(self.gen) except StopIteration: return False else: raise RuntimeError("generator didn't stop") else: if value is None: # Need to force instantiation so we can reliably # tell if we get the same exception back value = type() try: > self.gen.throw(type, value, traceback) /usr/lib/python3.7/contextlib.py:130: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <urllib3.response.HTTPResponse object at 0x7f1844996630> @contextmanager def _error_catcher(self): """ Catch low-level python exceptions, instead re-raising urllib3 variants, so that low-level exceptions are not leaked in the high-level api. On exit, release the connection back to the pool. """ clean_exit = False try: try: yield except SocketTimeout: # FIXME: Ideally we'd like to include the url in the ReadTimeoutError but # there is yet no clean way to get at it from this context. raise ReadTimeoutError(self._pool, None, "Read timed out.") except BaseSSLError as e: # FIXME: Is there a better way to differentiate between SSLErrors? if "read operation timed out" not in str(e): # SSL errors related to framing/MAC get wrapped and reraised here raise SSLError(e) raise ReadTimeoutError(self._pool, None, "Read timed out.") except (HTTPException, SocketError) as e: # This includes IncompleteRead. > raise ProtocolError("Connection broken: %r" % e, e) E urllib3.exceptions.ProtocolError: ("Connection broken: InvalidChunkLength(got length b'HTTP/1.1 500 Internal Server Error\\r\\n', 0 bytes read)", InvalidChunkLength(got length b'HTTP/1.1 500 Internal Server Error\r\n', 0 bytes read)) .tox/py3/lib/python3.7/site-packages/urllib3/response.py:455: ProtocolError During handling of the above exception, another exception occurred: graph_client = <RemoteGraphClient url=http://127.0.0.1:38789/graph/> def test_neighbors(graph_client): actual = list( graph_client.neighbors( > "swh:1:rev:0000000000000000000000000000000000000009", direction="backward" ) ) .tox/py3/lib/python3.7/site-packages/swh/graph/tests/test_api_client.py:52: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ .tox/py3/lib/python3.7/site-packages/swh/graph/client.py:31: in get_lines yield from self.raw_verb_lines("get", endpoint, **kwargs) .tox/py3/lib/python3.7/site-packages/swh/graph/client.py:27: in raw_verb_lines for line in response.iter_lines(): .tox/py3/lib/python3.7/site-packages/requests/models.py:797: in iter_lines for chunk in self.iter_content(chunk_size=chunk_size, decode_unicode=decode_unicode): _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def generate(): # Special case for urllib3. if hasattr(self.raw, 'stream'): try: for chunk in self.raw.stream(chunk_size, decode_content=True): yield chunk except ProtocolError as e: > raise ChunkedEncodingError(e) E requests.exceptions.ChunkedEncodingError: ("Connection broken: InvalidChunkLength(got length b'HTTP/1.1 500 Internal Server Error\\r\\n', 0 bytes read)", InvalidChunkLength(got length b'HTTP/1.1 500 Internal Server Error\r\n', 0 bytes read)) .tox/py3/lib/python3.7/site-packages/requests/models.py:756: ChunkedEncodingError