client = <django.test.client.Client object at 0x7f5736803c88>
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f5736803470>
def test_accept_pending_save_request(client, mocker):
mock_scheduler = mocker.patch("swh.web.common.origin_save.scheduler")
visit_type = "git"
origin_url = "https://v2.pikacode.com/bthate/botlib.git"
save_request_url = reverse(
"api-1-save-origin",
url_args={"visit_type": visit_type, "origin_url": origin_url},
)
> response = check_http_post_response(client, save_request_url, status_code=200)
.tox/py3/lib/python3.7/site-packages/swh/web/tests/admin/test_origin_save.py:131:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/py3/lib/python3.7/site-packages/swh/web/tests/utils.py:99: in check_http_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 73, in create_connection
E for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
E File "/usr/lib/python3.7/socket.py", line 748, in getaddrinfo
E for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
E socket.gaierror: [Errno -5] No address associated with hostname
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 382, in _make_request
E self._validate_conn(conn)
E File "/var/lib/jenkins/workspace/DWAPPS/tests-on-diff/.tox/py3/lib/python3.7/site-packages/urllib3/connectionpool.py", line 1010, in _validate_conn
E conn.connect()
E File "/var/lib/jenkins/workspace/DWAPPS/tests-on-diff/.tox/py3/lib/python3.7/site-packages/urllib3/connection.py", line 353, 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.HTTPSConnection object at 0x7f573787a908>: Failed to establish a new connection: [Errno -5] No address associated with hostname
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 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: HTTPSConnectionPool(host='v2.pikacode.com', port=443): Max retries exceeded with url: /bthate/botlib.git (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f573787a908>: Failed to establish a new connection: [Errno -5] No address associated with hostname'))
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 86, in api_save_origin
E sor = create_save_origin_request(visit_type, origin_url)
E File "/var/lib/jenkins/workspace/DWAPPS/tests-on-diff/.tox/py3/lib/python3.7/site-packages/swh/web/common/origin_save.py", line 375, in create_save_origin_request
E _check_origin_exists(origin_url)
E File "/var/lib/jenkins/workspace/DWAPPS/tests-on-diff/.tox/py3/lib/python3.7/site-packages/swh/web/common/origin_save.py", line 187, in _check_origin_exists
E check = origin_exists(origin_url)
E File "/var/lib/jenkins/workspace/DWAPPS/tests-on-diff/.tox/py3/lib/python3.7/site-packages/swh/web/common/origin_save.py", line 168, in origin_exists
E resp = requests.head(origin_url)
E File "/var/lib/jenkins/workspace/DWAPPS/tests-on-diff/.tox/py3/lib/python3.7/site-packages/requests/api.py", line 104, in head
E return request('head', url, **kwargs)
E File "/var/lib/jenkins/workspace/DWAPPS/tests-on-diff/.tox/py3/lib/python3.7/site-packages/requests/api.py", line 61, in request
E return session.request(method=method, url=url, **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: HTTPSConnectionPool(host='v2.pikacode.com', port=443): Max retries exceeded with url: /bthate/botlib.git (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f573787a908>: Failed to establish a new connection: [Errno -5] No address associated with hostname'))
E
E assert 500 == 200
E +500
E -200
.tox/py3/lib/python3.7/site-packages/swh/web/tests/utils.py:32: AssertionError
TEST RESULT
TEST RESULT
- Run At
- Apr 30 2021, 12:44 PM