api_client = <rest_framework.test.APIClient object at 0x7fea4a6f1630>
archive_data = <swh.web.tests.conftest._ArchiveData object at 0x7fea4a6f16d8>
content = {'blake2s256': 'f9ccb7742ca758d9271bb0882d36e6a05939b133a7e65c2ed0e1f2931e5d9727', 'data': '// !$*UTF8*$!\n{\n\t29B973...B58CAF4101992A200956BA2 /* libtess2 */,\n\t\t);\n\t};\n}\n', 'encoding': 'us-ascii', 'hljs_language': 'plaintext', ...}
def test_api_raw_content(api_client, archive_data, content):
object_id = content["sha1_git"]
object_ty = "cnt"
url = reverse(
"api-1-raw-object", url_args={"swhid_raw": f"swh:1:{object_ty}:{object_id}"}
)
> rv = check_http_get_response(api_client, url, status_code=200)
.tox/py3/lib/python3.7/site-packages/swh/web/tests/api/views/test_raw.py:38:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/py3/lib/python3.7/site-packages/swh/web/tests/utils.py:68: in check_http_get_response
content_type=content_type,
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
response = <Response status_code=503, "application/json">, status_code = 200
content_type = '*/*'
def _assert_http_response(
response: HttpResponse, status_code: int, content_type: str
) -> HttpResponse:
if isinstance(response, Response):
drf_response = cast(Response, response)
error_context = (
drf_response.data.pop("traceback")
if isinstance(drf_response.data, dict) and "traceback" in drf_response.data
else drf_response.data
)
elif isinstance(response, StreamingHttpResponse):
error_context = getattr(response, "traceback", response.streaming_content)
else:
error_context = getattr(response, "traceback", response.content)
> assert response.status_code == status_code, error_context
E AssertionError: Traceback (most recent call last):
E File "/var/lib/jenkins/workspace/DWAPPS/tests-on-diff@2/.tox/py3/lib/python3.7/site-packages/urllib3/connection.py", line 175, in _new_conn
E (self._dns_host, self.port), self.timeout, **extra_kw
E File "/var/lib/jenkins/workspace/DWAPPS/tests-on-diff@2/.tox/py3/lib/python3.7/site-packages/urllib3/util/connection.py", line 95, in create_connection
E raise err
E File "/var/lib/jenkins/workspace/DWAPPS/tests-on-diff@2/.tox/py3/lib/python3.7/site-packages/urllib3/util/connection.py", line 85, in create_connection
E sock.connect(sa)
E ConnectionRefusedError: [Errno 111] Connection refused
E
E During handling of the above exception, another exception occurred:
E
E Traceback (most recent call last):
E File "/var/lib/jenkins/workspace/DWAPPS/tests-on-diff@2/.tox/py3/lib/python3.7/site-packages/urllib3/connectionpool.py", line 710, in urlopen
E chunked=chunked,
E File "/var/lib/jenkins/workspace/DWAPPS/tests-on-diff@2/.tox/py3/lib/python3.7/site-packages/urllib3/connectionpool.py", line 398, in _make_request
E conn.request(method, url, **httplib_request_kw)
E File "/var/lib/jenkins/workspace/DWAPPS/tests-on-diff@2/.tox/py3/lib/python3.7/site-packages/urllib3/connection.py", line 239, in request
E super(HTTPConnection, self).request(method, url, body=body, headers=headers)
E File "/usr/lib/python3.7/http/client.py", line 1260, in request
E self._send_request(method, url, body, headers, encode_chunked)
E File "/usr/lib/python3.7/http/client.py", line 1306, in _send_request
E self.endheaders(body, encode_chunked=encode_chunked)
E File "/usr/lib/python3.7/http/client.py", line 1255, in endheaders
E self._send_output(message_body, encode_chunked=encode_chunked)
E File "/usr/lib/python3.7/http/client.py", line 1030, in _send_output
E self.send(msg)
E File "/usr/lib/python3.7/http/client.py", line 970, in send
E self.connect()
E File "/var/lib/jenkins/workspace/DWAPPS/tests-on-diff@2/.tox/py3/lib/python3.7/site-packages/urllib3/connection.py", line 205, in connect
E conn = self._new_conn()
E File "/var/lib/jenkins/workspace/DWAPPS/tests-on-diff@2/.tox/py3/lib/python3.7/site-packages/urllib3/connection.py", line 187, in _new_conn
E self, "Failed to establish a new connection: %s" % e
E urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7fea4a813fd0>: Failed to establish a new connection: [Errno 111] Connection refused
E
E During handling of the above exception, another exception occurred:
E
E Traceback (most recent call last):
E File "/var/lib/jenkins/workspace/DWAPPS/tests-on-diff@2/.tox/py3/lib/python3.7/site-packages/requests/adapters.py", line 450, in send
E timeout=timeout
E File "/var/lib/jenkins/workspace/DWAPPS/tests-on-diff@2/.tox/py3/lib/python3.7/site-packages/urllib3/connectionpool.py", line 826, in urlopen
E **response_kw
E File "/var/lib/jenkins/workspace/DWAPPS/tests-on-diff@2/.tox/py3/lib/python3.7/site-packages/urllib3/connectionpool.py", line 826, in urlopen
E **response_kw
E File "/var/lib/jenkins/workspace/DWAPPS/tests-on-diff@2/.tox/py3/lib/python3.7/site-packages/urllib3/connectionpool.py", line 826, in urlopen
E **response_kw
E File "/var/lib/jenkins/workspace/DWAPPS/tests-on-diff@2/.tox/py3/lib/python3.7/site-packages/urllib3/connectionpool.py", line 786, in urlopen
E method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
E File "/var/lib/jenkins/workspace/DWAPPS/tests-on-diff@2/.tox/py3/lib/python3.7/site-packages/urllib3/util/retry.py", line 592, in increment
E raise MaxRetryError(_pool, url, error or ResponseError(cause))
E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='127.0.0.1', port=5002): Max retries exceeded with url: /content/present (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fea4a813fd0>: Failed to establish a new connection: [Errno 111] Connection refused'))
E
E During handling of the above exception, another exception occurred:
E
E Traceback (most recent call last):
E File "/var/lib/jenkins/workspace/DWAPPS/tests-on-diff@2/.tox/py3/lib/python3.7/site-packages/swh/core/api/__init__.py", line 254, in raw_verb
E return getattr(self.session, verb)(self._url(endpoint), **opts)
E File "/var/lib/jenkins/workspace/DWAPPS/tests-on-diff@2/.tox/py3/lib/python3.7/site-packages/requests/sessions.py", line 577, in post
E return self.request('POST', url, data=data, json=json, **kwargs)
E File "/var/lib/jenkins/workspace/DWAPPS/tests-on-diff@2/.tox/py3/lib/python3.7/site-packages/requests/sessions.py", line 529, in request
E resp = self.send(prep, **send_kwargs)
E File "/var/lib/jenkins/workspace/DWAPPS/tests-on-diff@2/.tox/py3/lib/python3.7/site-packages/requests/sessions.py", line 645, in send
E r = adapter.send(request, **kwargs)
E File "/var/lib/jenkins/workspace/DWAPPS/tests-on-diff@2/.tox/py3/lib/python3.7/site-packages/requests/adapters.py", line 519, in send
E raise ConnectionError(e, request=request)
E requests.exceptions.ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=5002): Max retries exceeded with url: /content/present (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fea4a813fd0>: Failed to establish a new connection: [Errno 111] Connection refused'))
E
E During handling of the above exception, another exception occurred:
E
E Traceback (most recent call last):
E File "/var/lib/jenkins/workspace/DWAPPS/tests-on-diff@2/.tox/py3/lib/python3.7/site-packages/rest_framework/views.py", line 506, in dispatch
E response = handler(request, *args, **kwargs)
E File "/var/lib/jenkins/workspace/DWAPPS/tests-on-diff@2/.tox/py3/lib/python3.7/site-packages/rest_framework/decorators.py", line 50, in handler
E return func(*args, **kwargs)
E File "/var/lib/jenkins/workspace/DWAPPS/tests-on-diff@2/.tox/py3/lib/python3.7/site-packages/swh/web/api/apiurls.py", line 96, in api_view_f
E response = f(request, **kwargs)
E File "/var/lib/jenkins/workspace/DWAPPS/tests-on-diff@2/.tox/py3/lib/python3.7/site-packages/swh/web/api/apidoc.py", line 379, in documented_view
E raise exc
E File "/var/lib/jenkins/workspace/DWAPPS/tests-on-diff@2/.tox/py3/lib/python3.7/site-packages/swh/web/api/apidoc.py", line 376, in documented_view
E return {"data": f(request, **kwargs), "doc_data": doc_data}
E File "/var/lib/jenkins/workspace/DWAPPS/tests-on-diff@2/.tox/py3/lib/python3.7/site-packages/swh/web/api/views/raw.py", line 64, in api_raw_object
E results = storage.content_find({"sha1_git": object_id})
E File "/var/lib/jenkins/workspace/DWAPPS/tests-on-diff@2/.tox/py3/lib/python3.7/site-packages/swh/core/api/__init__.py", line 183, in meth_
E return self._post(meth._endpoint_path, post_data)
E File "/var/lib/jenkins/workspace/DWAPPS/tests-on-diff@2/.tox/py3/lib/python3.7/site-packages/swh/core/api/__init__.py", line 272, in _post
E **opts,
E File "/var/lib/jenkins/workspace/DWAPPS/tests-on-diff@2/.tox/py3/lib/python3.7/site-packages/swh/core/api/__init__.py", line 256, in raw_verb
E raise self.api_exception(e)
E swh.storage.exc.StorageAPIError: An unexpected error occurred in the api backend: HTTPConnectionPool(host='127.0.0.1', port=5002): Max retries exceeded with url: /content/present (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fea4a813fd0>: Failed to establish a new connection: [Errno 111] Connection refused'))
E
E assert 503 == 200
E + where 503 = <Response status_code=503, "application/json">.status_code
.tox/py3/lib/python3.7/site-packages/swh/web/tests/utils.py:34: AssertionError
TEST RESULT
TEST RESULT
- Run At
- Apr 27 2022, 9:18 PM