Page MenuHomeSoftware Heritage

Jenkins > .tox.py3.lib.python3.7.site-packages.swh.web.tests.api.views.test_origin_save::Tests / Python tests / test_create_save_request_authenticated_user_id
Failed

TEST RESULT

Run At
May 4 2021, 2:58 PM
Details
api_client = <rest_framework.test.APIClient object at 0x7ff296ec0c88> origin_to_review = 'https://git.example.org/user/project' keycloak_oidc = <swh.auth.pytest_plugin.KeycloackOpenIDConnectMock object at 0x7ff296ec0908> mocker = <pytest_mock.plugin.MockerFixture object at 0x7ff29a022f28> def test_create_save_request_authenticated_user_id( api_client, origin_to_review, keycloak_oidc, mocker ): oidc_profile = keycloak_oidc.login() api_client.credentials(HTTP_AUTHORIZATION=f"Bearer {oidc_profile['refresh_token']}") origin_url = "http://github.com/user/repo2" url = reverse( "api-1-save-origin", url_args={"visit_type": "git", "origin_url": origin_url}, ) > response = check_api_post_response(api_client, url, status_code=200) .tox/py3/lib/python3.7/site-packages/swh/web/tests/api/views/test_origin_save.py:505: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ .tox/py3/lib/python3.7/site-packages/swh/web/tests/utils.py:156: in check_api_post_response content_type=content_type, _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ response = <Response status_code=500, "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/.tox/py3/lib/python3.7/site-packages/urllib3/connection.py", line 170, in _new_conn E (self._dns_host, self.port), self.timeout, **extra_kw E File "/var/lib/jenkins/workspace/DWAPPS/tests-on-diff/.tox/py3/lib/python3.7/site-packages/urllib3/util/connection.py", line 96, in create_connection E raise err E File "/var/lib/jenkins/workspace/DWAPPS/tests-on-diff/.tox/py3/lib/python3.7/site-packages/urllib3/util/connection.py", line 86, 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/.tox/py3/lib/python3.7/site-packages/urllib3/connectionpool.py", line 706, in urlopen E chunked=chunked, E File "/var/lib/jenkins/workspace/DWAPPS/tests-on-diff/.tox/py3/lib/python3.7/site-packages/urllib3/connectionpool.py", line 394, in _make_request E conn.request(method, url, **httplib_request_kw) E File "/var/lib/jenkins/workspace/DWAPPS/tests-on-diff/.tox/py3/lib/python3.7/site-packages/urllib3/connection.py", line 234, 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/.tox/py3/lib/python3.7/site-packages/urllib3/connection.py", line 200, in connect E conn = self._new_conn() E File "/var/lib/jenkins/workspace/DWAPPS/tests-on-diff/.tox/py3/lib/python3.7/site-packages/urllib3/connection.py", line 182, in _new_conn E self, "Failed to establish a new connection: %s" % e E urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7ff29527ca90>: 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/.tox/py3/lib/python3.7/site-packages/requests/adapters.py", line 449, in send E timeout=timeout E File "/var/lib/jenkins/workspace/DWAPPS/tests-on-diff/.tox/py3/lib/python3.7/site-packages/urllib3/connectionpool.py", line 796, in urlopen E **response_kw E File "/var/lib/jenkins/workspace/DWAPPS/tests-on-diff/.tox/py3/lib/python3.7/site-packages/urllib3/connectionpool.py", line 796, in urlopen E **response_kw E File "/var/lib/jenkins/workspace/DWAPPS/tests-on-diff/.tox/py3/lib/python3.7/site-packages/urllib3/connectionpool.py", line 796, in urlopen E **response_kw E File "/var/lib/jenkins/workspace/DWAPPS/tests-on-diff/.tox/py3/lib/python3.7/site-packages/urllib3/connectionpool.py", line 756, in urlopen E method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2] E File "/var/lib/jenkins/workspace/DWAPPS/tests-on-diff/.tox/py3/lib/python3.7/site-packages/urllib3/util/retry.py", line 574, in increment E raise MaxRetryError(_pool, url, error or ResponseError(cause)) E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='127.0.0.1', port=5008): Max retries exceeded with url: /task/create (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7ff29527ca90>: 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/.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/.tox/py3/lib/python3.7/site-packages/requests/sessions.py", line 590, in post E return self.request('POST', url, data=data, json=json, **kwargs) E File "/var/lib/jenkins/workspace/DWAPPS/tests-on-diff/.tox/py3/lib/python3.7/site-packages/requests/sessions.py", line 542, in request E resp = self.send(prep, **send_kwargs) E File "/var/lib/jenkins/workspace/DWAPPS/tests-on-diff/.tox/py3/lib/python3.7/site-packages/requests/sessions.py", line 655, in send E r = adapter.send(request, **kwargs) E File "/var/lib/jenkins/workspace/DWAPPS/tests-on-diff/.tox/py3/lib/python3.7/site-packages/requests/adapters.py", line 516, in send E raise ConnectionError(e, request=request) E requests.exceptions.ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=5008): Max retries exceeded with url: /task/create (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7ff29527ca90>: 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/.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/.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/.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/.tox/py3/lib/python3.7/site-packages/swh/web/api/apidoc.py", line 348, in documented_view E raise exc E File "/var/lib/jenkins/workspace/DWAPPS/tests-on-diff/.tox/py3/lib/python3.7/site-packages/swh/web/api/apidoc.py", line 345, in documented_view E return {"data": f(request, **kwargs), "doc_data": doc_data} E File "/var/lib/jenkins/workspace/DWAPPS/tests-on-diff/.tox/py3/lib/python3.7/site-packages/swh/web/api/views/origin_save.py", line 91, in api_save_origin E visit_type, origin_url, bypass_pending_review, user_id=request.user.id E File "/var/lib/jenkins/workspace/DWAPPS/tests-on-diff/.tox/py3/lib/python3.7/site-packages/swh/web/common/origin_save.py", line 438, in create_save_origin_request E task = scheduler.create_tasks([task_dict])[0] E File "/var/lib/jenkins/workspace/DWAPPS/tests-on-diff/.tox/py3/lib/python3.7/site-packages/swh/core/api/__init__.py", line 181, in meth_ E return self.post(meth._endpoint_path, post_data) E File "/var/lib/jenkins/workspace/DWAPPS/tests-on-diff/.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/.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.core.api.APIError: An unexpected error occurred in the backend: (ConnectionError(MaxRetryError("HTTPConnectionPool(host='127.0.0.1', port=5008): Max retries exceeded with url: /task/create (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7ff29527ca90>: Failed to establish a new connection: [Errno 111] Connection refused'))")),) E E assert 500 == 200 E +500 E -200 .tox/py3/lib/python3.7/site-packages/swh/web/tests/utils.py:32: AssertionError