Expose analyze endpoint (#376) #1144
88 tests run, 31 passed, 5 skipped, 52 failed.
Annotations
Check failure on line 41 in tests/jms/test_algorithms.py
github-actions / Test Report ubuntu-latest:3.12
test_algorithms
ansys.hps.client.exceptions.APIError: 503 Server Error: Service Unavailable for: POST https://localhost:8443/hps/jms/api/v1/projects/?fields=all
Raw output
client = <ansys.hps.client.client.Client object at 0x7f515e43da60>
def test_algorithms(client):
log.debug("=== Client ===")
client = client
jms_api = JmsApi(client)
proj_name = f"rep_client_test_jms_AlgorithmsTest"
proj = Project(name=proj_name, active=True)
> proj = jms_api.create_project(proj, replace=True)
tests/jms/test_algorithms.py:41:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/py312-coverage/lib/python3.12/site-packages/ansys/hps/client/jms/api/jms_api.py:120: in create_project
return create_project(self.client, self.url, project, replace, as_objects)
.tox/py312-coverage/lib/python3.12/site-packages/ansys/hps/client/jms/api/jms_api.py:334: in create_project
r = client.session.post(f"{url}", data=json_data)
.tox/py312-coverage/lib/python3.12/site-packages/requests/sessions.py:637: in post
return self.request("POST", url, data=data, json=json, **kwargs)
.tox/py312-coverage/lib/python3.12/site-packages/requests/sessions.py:589: in request
resp = self.send(prep, **send_kwargs)
.tox/py312-coverage/lib/python3.12/site-packages/requests/sessions.py:710: in send
r = dispatch_hook("response", hooks, r, **kwargs)
.tox/py312-coverage/lib/python3.12/site-packages/requests/hooks.py:30: in dispatch_hook
_hook_data = hook(hook_data, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
response = <Response [503]>, args = ()
kwargs = {'cert': None, 'proxies': OrderedDict(), 'stream': False, 'timeout': None, ...}
r_content = {}, reason = 'Service Unavailable', description = None
error_msg = '503 Server Error: Service Unavailable for: POST https://localhost:8443/hps/jms/api/v1/projects/?fields=all'
def raise_for_status(response, *args, **kwargs):
"""Automatically checks HTTP errors.
This method mimics the requests.Response.raise_for_status() method.
"""
if 400 <= response.status_code < 600:
r_content = {}
try:
r_content = response.json()
except ValueError:
pass
reason = r_content.get("title", None) # jms api
if not reason:
reason = r_content.get("error", None) # auth api
if not reason:
reason = response.reason
description = r_content.get("description", None) # jms api
if not description:
description = r_content.get("error_description", None) # auth api
if 400 <= response.status_code < 500:
error_msg = "%s Client Error: %s for: %s %s" % (
response.status_code,
reason,
response.request.method,
response.url,
)
if description:
error_msg += f"\n{description}"
raise ClientError(error_msg, reason=reason, description=description, response=response)
elif 500 <= response.status_code < 600:
error_msg = "%s Server Error: %s for: %s %s" % (
response.status_code,
reason,
response.request.method,
response.url,
)
if description:
error_msg += f"\n{description}"
> raise APIError(error_msg, reason=reason, description=description, response=response)
E ansys.hps.client.exceptions.APIError: 503 Server Error: Service Unavailable for: POST https://localhost:8443/hps/jms/api/v1/projects/?fields=all
.tox/py312-coverage/lib/python3.12/site-packages/ansys/hps/client/exceptions.py:108: APIError
Check failure on line 39 in tests/jms/test_files.py
github-actions / Test Report ubuntu-latest:3.12
test_files
ansys.hps.client.exceptions.APIError: 503 Server Error: Service Unavailable for: POST https://localhost:8443/hps/jms/api/v1/projects/?fields=all
Raw output
client = <ansys.hps.client.client.Client object at 0x7f515e43da60>
def test_files(client):
jms_api = JmsApi(client)
> proj = jms_api.create_project(
Project(name=f"rep_client_test_jms_FilesTest", active=False), replace=True
)
tests/jms/test_files.py:39:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/py312-coverage/lib/python3.12/site-packages/ansys/hps/client/jms/api/jms_api.py:120: in create_project
return create_project(self.client, self.url, project, replace, as_objects)
.tox/py312-coverage/lib/python3.12/site-packages/ansys/hps/client/jms/api/jms_api.py:334: in create_project
r = client.session.post(f"{url}", data=json_data)
.tox/py312-coverage/lib/python3.12/site-packages/requests/sessions.py:637: in post
return self.request("POST", url, data=data, json=json, **kwargs)
.tox/py312-coverage/lib/python3.12/site-packages/requests/sessions.py:589: in request
resp = self.send(prep, **send_kwargs)
.tox/py312-coverage/lib/python3.12/site-packages/requests/sessions.py:710: in send
r = dispatch_hook("response", hooks, r, **kwargs)
.tox/py312-coverage/lib/python3.12/site-packages/requests/hooks.py:30: in dispatch_hook
_hook_data = hook(hook_data, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
response = <Response [503]>, args = ()
kwargs = {'cert': None, 'proxies': OrderedDict(), 'stream': False, 'timeout': None, ...}
r_content = {}, reason = 'Service Unavailable', description = None
error_msg = '503 Server Error: Service Unavailable for: POST https://localhost:8443/hps/jms/api/v1/projects/?fields=all'
def raise_for_status(response, *args, **kwargs):
"""Automatically checks HTTP errors.
This method mimics the requests.Response.raise_for_status() method.
"""
if 400 <= response.status_code < 600:
r_content = {}
try:
r_content = response.json()
except ValueError:
pass
reason = r_content.get("title", None) # jms api
if not reason:
reason = r_content.get("error", None) # auth api
if not reason:
reason = response.reason
description = r_content.get("description", None) # jms api
if not description:
description = r_content.get("error_description", None) # auth api
if 400 <= response.status_code < 500:
error_msg = "%s Client Error: %s for: %s %s" % (
response.status_code,
reason,
response.request.method,
response.url,
)
if description:
error_msg += f"\n{description}"
raise ClientError(error_msg, reason=reason, description=description, response=response)
elif 500 <= response.status_code < 600:
error_msg = "%s Server Error: %s for: %s %s" % (
response.status_code,
reason,
response.request.method,
response.url,
)
if description:
error_msg += f"\n{description}"
> raise APIError(error_msg, reason=reason, description=description, response=response)
E ansys.hps.client.exceptions.APIError: 503 Server Error: Service Unavailable for: POST https://localhost:8443/hps/jms/api/v1/projects/?fields=all
.tox/py312-coverage/lib/python3.12/site-packages/ansys/hps/client/exceptions.py:108: APIError
Check failure on line 137 in tests/jms/test_files.py
github-actions / Test Report ubuntu-latest:3.12
test_files.test_download_file_in_subdir
ansys.hps.client.exceptions.APIError: 503 Server Error: Service Unavailable for: POST https://localhost:8443/hps/jms/api/v1/projects/?fields=all
Raw output
client = <ansys.hps.client.client.Client object at 0x7f515e43da60>
def test_download_file_in_subdir(client):
jms_api = JmsApi(client)
> proj = jms_api.create_project(Project(name=f"rep_test_download_file_in_subdir", active=False))
tests/jms/test_files.py:137:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/py312-coverage/lib/python3.12/site-packages/ansys/hps/client/jms/api/jms_api.py:120: in create_project
return create_project(self.client, self.url, project, replace, as_objects)
.tox/py312-coverage/lib/python3.12/site-packages/ansys/hps/client/jms/api/jms_api.py:334: in create_project
r = client.session.post(f"{url}", data=json_data)
.tox/py312-coverage/lib/python3.12/site-packages/requests/sessions.py:637: in post
return self.request("POST", url, data=data, json=json, **kwargs)
.tox/py312-coverage/lib/python3.12/site-packages/requests/sessions.py:589: in request
resp = self.send(prep, **send_kwargs)
.tox/py312-coverage/lib/python3.12/site-packages/requests/sessions.py:710: in send
r = dispatch_hook("response", hooks, r, **kwargs)
.tox/py312-coverage/lib/python3.12/site-packages/requests/hooks.py:30: in dispatch_hook
_hook_data = hook(hook_data, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
response = <Response [503]>, args = ()
kwargs = {'cert': None, 'proxies': OrderedDict(), 'stream': False, 'timeout': None, ...}
r_content = {}, reason = 'Service Unavailable', description = None
error_msg = '503 Server Error: Service Unavailable for: POST https://localhost:8443/hps/jms/api/v1/projects/?fields=all'
def raise_for_status(response, *args, **kwargs):
"""Automatically checks HTTP errors.
This method mimics the requests.Response.raise_for_status() method.
"""
if 400 <= response.status_code < 600:
r_content = {}
try:
r_content = response.json()
except ValueError:
pass
reason = r_content.get("title", None) # jms api
if not reason:
reason = r_content.get("error", None) # auth api
if not reason:
reason = response.reason
description = r_content.get("description", None) # jms api
if not description:
description = r_content.get("error_description", None) # auth api
if 400 <= response.status_code < 500:
error_msg = "%s Client Error: %s for: %s %s" % (
response.status_code,
reason,
response.request.method,
response.url,
)
if description:
error_msg += f"\n{description}"
raise ClientError(error_msg, reason=reason, description=description, response=response)
elif 500 <= response.status_code < 600:
error_msg = "%s Server Error: %s for: %s %s" % (
response.status_code,
reason,
response.request.method,
response.url,
)
if description:
error_msg += f"\n{description}"
> raise APIError(error_msg, reason=reason, description=description, response=response)
E ansys.hps.client.exceptions.APIError: 503 Server Error: Service Unavailable for: POST https://localhost:8443/hps/jms/api/v1/projects/?fields=all
.tox/py312-coverage/lib/python3.12/site-packages/ansys/hps/client/exceptions.py:108: APIError
Check failure on line 140 in tests/jms/test_fitness_definition.py
github-actions / Test Report ubuntu-latest:3.12
test_fitness_definition.test_fitness_definition_integration
ansys.hps.client.exceptions.APIError: 503 Server Error: Service Unavailable for: POST https://localhost:8443/hps/jms/api/v1/projects/?fields=all
Raw output
client = <ansys.hps.client.client.Client object at 0x7f515e43da60>
def test_fitness_definition_integration(client):
proj_name = f"test_jms_FitnessDefinitionTest"
proj = Project(name=proj_name, active=True)
jms_api = JmsApi(client)
> proj = jms_api.create_project(proj, replace=True)
tests/jms/test_fitness_definition.py:140:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/py312-coverage/lib/python3.12/site-packages/ansys/hps/client/jms/api/jms_api.py:120: in create_project
return create_project(self.client, self.url, project, replace, as_objects)
.tox/py312-coverage/lib/python3.12/site-packages/ansys/hps/client/jms/api/jms_api.py:334: in create_project
r = client.session.post(f"{url}", data=json_data)
.tox/py312-coverage/lib/python3.12/site-packages/requests/sessions.py:637: in post
return self.request("POST", url, data=data, json=json, **kwargs)
.tox/py312-coverage/lib/python3.12/site-packages/requests/sessions.py:589: in request
resp = self.send(prep, **send_kwargs)
.tox/py312-coverage/lib/python3.12/site-packages/requests/sessions.py:710: in send
r = dispatch_hook("response", hooks, r, **kwargs)
.tox/py312-coverage/lib/python3.12/site-packages/requests/hooks.py:30: in dispatch_hook
_hook_data = hook(hook_data, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
response = <Response [503]>, args = ()
kwargs = {'cert': None, 'proxies': OrderedDict(), 'stream': False, 'timeout': None, ...}
r_content = {}, reason = 'Service Unavailable', description = None
error_msg = '503 Server Error: Service Unavailable for: POST https://localhost:8443/hps/jms/api/v1/projects/?fields=all'
def raise_for_status(response, *args, **kwargs):
"""Automatically checks HTTP errors.
This method mimics the requests.Response.raise_for_status() method.
"""
if 400 <= response.status_code < 600:
r_content = {}
try:
r_content = response.json()
except ValueError:
pass
reason = r_content.get("title", None) # jms api
if not reason:
reason = r_content.get("error", None) # auth api
if not reason:
reason = response.reason
description = r_content.get("description", None) # jms api
if not description:
description = r_content.get("error_description", None) # auth api
if 400 <= response.status_code < 500:
error_msg = "%s Client Error: %s for: %s %s" % (
response.status_code,
reason,
response.request.method,
response.url,
)
if description:
error_msg += f"\n{description}"
raise ClientError(error_msg, reason=reason, description=description, response=response)
elif 500 <= response.status_code < 600:
error_msg = "%s Server Error: %s for: %s %s" % (
response.status_code,
reason,
response.request.method,
response.url,
)
if description:
error_msg += f"\n{description}"
> raise APIError(error_msg, reason=reason, description=description, response=response)
E ansys.hps.client.exceptions.APIError: 503 Server Error: Service Unavailable for: POST https://localhost:8443/hps/jms/api/v1/projects/?fields=all
.tox/py312-coverage/lib/python3.12/site-packages/ansys/hps/client/exceptions.py:108: APIError
Check failure on line 48 in tests/jms/test_jms_api.py
github-actions / Test Report ubuntu-latest:3.12
test_jms_api.test_jms_api_info
requests.exceptions.RetryError: HTTPSConnectionPool(host='localhost', port=8443): Max retries exceeded with url: /hps/jms/api/v1/storage?fields=all (Caused by ResponseError('too many 503 error responses'))
Raw output
urllib3.exceptions.ResponseError: too many 503 error responses
The above exception was the direct cause of the following exception:
self = <requests.adapters.HTTPAdapter object at 0x7f515e43df40>
request = <PreparedRequest [GET]>, stream = False
timeout = Timeout(connect=None, read=None, total=None), verify = False
cert = None, proxies = OrderedDict()
def send(
self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None
):
"""Sends PreparedRequest object. Returns Response object.
:param request: The :class:`PreparedRequest <PreparedRequest>` being sent.
:param stream: (optional) Whether to stream the request content.
:param timeout: (optional) How long to wait for the server to send
data before giving up, as a float, or a :ref:`(connect timeout,
read timeout) <timeouts>` tuple.
:type timeout: float or tuple or urllib3 Timeout object
:param verify: (optional) Either a boolean, in which case it controls whether
we verify the server's TLS certificate, or a string, in which case it
must be a path to a CA bundle to use
:param cert: (optional) Any user-provided SSL certificate to be trusted.
:param proxies: (optional) The proxies dictionary to apply to the request.
:rtype: requests.Response
"""
try:
conn = self.get_connection(request.url, proxies)
except LocationValueError as e:
raise InvalidURL(e, request=request)
self.cert_verify(conn, request.url, verify, cert)
url = self.request_url(request, proxies)
self.add_headers(
request,
stream=stream,
timeout=timeout,
verify=verify,
cert=cert,
proxies=proxies,
)
chunked = not (request.body is None or "Content-Length" in request.headers)
if isinstance(timeout, tuple):
try:
connect, read = timeout
timeout = TimeoutSauce(connect=connect, read=read)
except ValueError:
raise ValueError(
f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, "
f"or a single float to set both timeouts to the same value."
)
elif isinstance(timeout, TimeoutSauce):
pass
else:
timeout = TimeoutSauce(connect=timeout, read=timeout)
try:
> resp = conn.urlopen(
method=request.method,
url=url,
body=request.body,
headers=request.headers,
redirect=False,
assert_same_host=False,
preload_content=False,
decode_content=False,
retries=self.max_retries,
timeout=timeout,
chunked=chunked,
)
.tox/py312-coverage/lib/python3.12/site-packages/requests/adapters.py:486:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/py312-coverage/lib/python3.12/site-packages/urllib3/connectionpool.py:948: in urlopen
return self.urlopen(
.tox/py312-coverage/lib/python3.12/site-packages/urllib3/connectionpool.py:948: in urlopen
return self.urlopen(
.tox/py312-coverage/lib/python3.12/site-packages/urllib3/connectionpool.py:948: in urlopen
return self.urlopen(
.tox/py312-coverage/lib/python3.12/site-packages/urllib3/connectionpool.py:948: in urlopen
return self.urlopen(
.tox/py312-coverage/lib/python3.12/site-packages/urllib3/connectionpool.py:948: in urlopen
return self.urlopen(
.tox/py312-coverage/lib/python3.12/site-packages/urllib3/connectionpool.py:938: in urlopen
retries = retries.increment(method, url, response=response, _pool=self)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = Retry(total=0, connect=None, read=None, redirect=None, status=None)
method = 'GET', url = '/hps/jms/api/v1/storage?fields=all'
response = <urllib3.response.HTTPResponse object at 0x7f515e4dbfa0>
error = None
_pool = <urllib3.connectionpool.HTTPSConnectionPool object at 0x7f515e4d54f0>
_stacktrace = None
def increment(
self,
method: str | None = None,
url: str | None = None,
response: BaseHTTPResponse | None = None,
error: Exception | None = None,
_pool: ConnectionPool | None = None,
_stacktrace: TracebackType | None = None,
) -> Retry:
"""Return a new Retry object with incremented retry counters.
:param response: A response object, or None, if the server did not
return a response.
:type response: :class:`~urllib3.response.BaseHTTPResponse`
:param Exception error: An error encountered during the request, or
None if the response was received successfully.
:return: A new ``Retry`` object.
"""
if self.total is False and error:
# Disabled, indicate to re-raise the error.
raise reraise(type(error), error, _stacktrace)
total = self.total
if total is not None:
total -= 1
connect = self.connect
read = self.read
redirect = self.redirect
status_count = self.status
other = self.other
cause = "unknown"
status = None
redirect_location = None
if error and self._is_connection_error(error):
# Connect retry?
if connect is False:
raise reraise(type(error), error, _stacktrace)
elif connect is not None:
connect -= 1
elif error and self._is_read_error(error):
# Read retry?
if read is False or method is None or not self._is_method_retryable(method):
raise reraise(type(error), error, _stacktrace)
elif read is not None:
read -= 1
elif error:
# Other retry?
if other is not None:
other -= 1
elif response and response.get_redirect_location():
# Redirect retry?
if redirect is not None:
redirect -= 1
cause = "too many redirects"
response_redirect_location = response.get_redirect_location()
if response_redirect_location:
redirect_location = response_redirect_location
status = response.status
else:
# Incrementing because of a server error like a 500 in
# status_forcelist and the given method is in the allowed_methods
cause = ResponseError.GENERIC_ERROR
if response and response.status:
if status_count is not None:
status_count -= 1
cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status)
status = response.status
history = self.history + (
RequestHistory(method, url, error, status, redirect_location),
)
new_retry = self.new(
total=total,
connect=connect,
read=read,
redirect=redirect,
status=status_count,
other=other,
history=history,
)
if new_retry.is_exhausted():
reason = error or ResponseError(cause)
> raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]
E urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='localhost', port=8443): Max retries exceeded with url: /hps/jms/api/v1/storage?fields=all (Caused by ResponseError('too many 503 error responses'))
.tox/py312-coverage/lib/python3.12/site-packages/urllib3/util/retry.py:515: MaxRetryError
During handling of the above exception, another exception occurred:
client = <ansys.hps.client.client.Client object at 0x7f515e43da60>
def test_jms_api_info(client):
jms_api = JmsApi(client)
assert jms_api.url.endswith("/jms/api/v1")
> assert jms_api.fs_url.endswith("/fs/api/v1")
tests/jms/test_jms_api.py:48:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/py312-coverage/lib/python3.12/site-packages/ansys/hps/client/jms/api/jms_api.py:81: in fs_url
self._fs_url = _find_available_fs_url(self.get_storage())
.tox/py312-coverage/lib/python3.12/site-packages/ansys/hps/client/jms/api/jms_api.py:278: in get_storage
return _get_storages(self.client, self.url)
.tox/py312-coverage/lib/python3.12/site-packages/ansys/hps/client/jms/api/jms_api.py:462: in _get_storages
r = client.session.get(url)
.tox/py312-coverage/lib/python3.12/site-packages/requests/sessions.py:602: in get
return self.request("GET", url, **kwargs)
.tox/py312-coverage/lib/python3.12/site-packages/requests/sessions.py:589: in request
resp = self.send(prep, **send_kwargs)
.tox/py312-coverage/lib/python3.12/site-packages/requests/sessions.py:703: in send
r = adapter.send(request, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <requests.adapters.HTTPAdapter object at 0x7f515e43df40>
request = <PreparedRequest [GET]>, stream = False
timeout = Timeout(connect=None, read=None, total=None), verify = False
cert = None, proxies = OrderedDict()
def send(
self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None
):
"""Sends PreparedRequest object. Returns Response object.
:param request: The :class:`PreparedRequest <PreparedRequest>` being sent.
:param stream: (optional) Whether to stream the request content.
:param timeout: (optional) How long to wait for the server to send
data before giving up, as a float, or a :ref:`(connect timeout,
read timeout) <timeouts>` tuple.
:type timeout: float or tuple or urllib3 Timeout object
:param verify: (optional) Either a boolean, in which case it controls whether
we verify the server's TLS certificate, or a string, in which case it
must be a path to a CA bundle to use
:param cert: (optional) Any user-provided SSL certificate to be trusted.
:param proxies: (optional) The proxies dictionary to apply to the request.
:rtype: requests.Response
"""
try:
conn = self.get_connection(request.url, proxies)
except LocationValueError as e:
raise InvalidURL(e, request=request)
self.cert_verify(conn, request.url, verify, cert)
url = self.request_url(request, proxies)
self.add_headers(
request,
stream=stream,
timeout=timeout,
verify=verify,
cert=cert,
proxies=proxies,
)
chunked = not (request.body is None or "Content-Length" in request.headers)
if isinstance(timeout, tuple):
try:
connect, read = timeout
timeout = TimeoutSauce(connect=connect, read=read)
except ValueError:
raise ValueError(
f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, "
f"or a single float to set both timeouts to the same value."
)
elif isinstance(timeout, TimeoutSauce):
pass
else:
timeout = TimeoutSauce(connect=timeout, read=timeout)
try:
resp = conn.urlopen(
method=request.method,
url=url,
body=request.body,
headers=request.headers,
redirect=False,
assert_same_host=False,
preload_content=False,
decode_content=False,
retries=self.max_retries,
timeout=timeout,
chunked=chunked,
)
except (ProtocolError, OSError) as err:
raise ConnectionError(err, request=request)
except MaxRetryError as e:
if isinstance(e.reason, ConnectTimeoutError):
# TODO: Remove this in 3.0.0: see #2811
if not isinstance(e.reason, NewConnectionError):
raise ConnectTimeout(e, request=request)
if isinstance(e.reason, ResponseError):
> raise RetryError(e, request=request)
E requests.exceptions.RetryError: HTTPSConnectionPool(host='localhost', port=8443): Max retries exceeded with url: /hps/jms/api/v1/storage?fields=all (Caused by ResponseError('too many 503 error responses'))
.tox/py312-coverage/lib/python3.12/site-packages/requests/adapters.py:510: RetryError
Check failure on line 59 in tests/jms/test_jms_api.py
github-actions / Test Report ubuntu-latest:3.12
test_jms_api.test_unavailable_fs_url
requests.exceptions.RetryError: HTTPSConnectionPool(host='localhost', port=8443): Max retries exceeded with url: /hps/jms/api/v1/storage?fields=all (Caused by ResponseError('too many 503 error responses'))
Raw output
urllib3.exceptions.ResponseError: too many 503 error responses
The above exception was the direct cause of the following exception:
self = <requests.adapters.HTTPAdapter object at 0x7f515e43df40>
request = <PreparedRequest [GET]>, stream = False
timeout = Timeout(connect=None, read=None, total=None), verify = False
cert = None, proxies = OrderedDict()
def send(
self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None
):
"""Sends PreparedRequest object. Returns Response object.
:param request: The :class:`PreparedRequest <PreparedRequest>` being sent.
:param stream: (optional) Whether to stream the request content.
:param timeout: (optional) How long to wait for the server to send
data before giving up, as a float, or a :ref:`(connect timeout,
read timeout) <timeouts>` tuple.
:type timeout: float or tuple or urllib3 Timeout object
:param verify: (optional) Either a boolean, in which case it controls whether
we verify the server's TLS certificate, or a string, in which case it
must be a path to a CA bundle to use
:param cert: (optional) Any user-provided SSL certificate to be trusted.
:param proxies: (optional) The proxies dictionary to apply to the request.
:rtype: requests.Response
"""
try:
conn = self.get_connection(request.url, proxies)
except LocationValueError as e:
raise InvalidURL(e, request=request)
self.cert_verify(conn, request.url, verify, cert)
url = self.request_url(request, proxies)
self.add_headers(
request,
stream=stream,
timeout=timeout,
verify=verify,
cert=cert,
proxies=proxies,
)
chunked = not (request.body is None or "Content-Length" in request.headers)
if isinstance(timeout, tuple):
try:
connect, read = timeout
timeout = TimeoutSauce(connect=connect, read=read)
except ValueError:
raise ValueError(
f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, "
f"or a single float to set both timeouts to the same value."
)
elif isinstance(timeout, TimeoutSauce):
pass
else:
timeout = TimeoutSauce(connect=timeout, read=timeout)
try:
> resp = conn.urlopen(
method=request.method,
url=url,
body=request.body,
headers=request.headers,
redirect=False,
assert_same_host=False,
preload_content=False,
decode_content=False,
retries=self.max_retries,
timeout=timeout,
chunked=chunked,
)
.tox/py312-coverage/lib/python3.12/site-packages/requests/adapters.py:486:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/py312-coverage/lib/python3.12/site-packages/urllib3/connectionpool.py:948: in urlopen
return self.urlopen(
.tox/py312-coverage/lib/python3.12/site-packages/urllib3/connectionpool.py:948: in urlopen
return self.urlopen(
.tox/py312-coverage/lib/python3.12/site-packages/urllib3/connectionpool.py:948: in urlopen
return self.urlopen(
.tox/py312-coverage/lib/python3.12/site-packages/urllib3/connectionpool.py:948: in urlopen
return self.urlopen(
.tox/py312-coverage/lib/python3.12/site-packages/urllib3/connectionpool.py:948: in urlopen
return self.urlopen(
.tox/py312-coverage/lib/python3.12/site-packages/urllib3/connectionpool.py:938: in urlopen
retries = retries.increment(method, url, response=response, _pool=self)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = Retry(total=0, connect=None, read=None, redirect=None, status=None)
method = 'GET', url = '/hps/jms/api/v1/storage?fields=all'
response = <urllib3.response.HTTPResponse object at 0x7f515e365480>
error = None
_pool = <urllib3.connectionpool.HTTPSConnectionPool object at 0x7f515e4d54f0>
_stacktrace = None
def increment(
self,
method: str | None = None,
url: str | None = None,
response: BaseHTTPResponse | None = None,
error: Exception | None = None,
_pool: ConnectionPool | None = None,
_stacktrace: TracebackType | None = None,
) -> Retry:
"""Return a new Retry object with incremented retry counters.
:param response: A response object, or None, if the server did not
return a response.
:type response: :class:`~urllib3.response.BaseHTTPResponse`
:param Exception error: An error encountered during the request, or
None if the response was received successfully.
:return: A new ``Retry`` object.
"""
if self.total is False and error:
# Disabled, indicate to re-raise the error.
raise reraise(type(error), error, _stacktrace)
total = self.total
if total is not None:
total -= 1
connect = self.connect
read = self.read
redirect = self.redirect
status_count = self.status
other = self.other
cause = "unknown"
status = None
redirect_location = None
if error and self._is_connection_error(error):
# Connect retry?
if connect is False:
raise reraise(type(error), error, _stacktrace)
elif connect is not None:
connect -= 1
elif error and self._is_read_error(error):
# Read retry?
if read is False or method is None or not self._is_method_retryable(method):
raise reraise(type(error), error, _stacktrace)
elif read is not None:
read -= 1
elif error:
# Other retry?
if other is not None:
other -= 1
elif response and response.get_redirect_location():
# Redirect retry?
if redirect is not None:
redirect -= 1
cause = "too many redirects"
response_redirect_location = response.get_redirect_location()
if response_redirect_location:
redirect_location = response_redirect_location
status = response.status
else:
# Incrementing because of a server error like a 500 in
# status_forcelist and the given method is in the allowed_methods
cause = ResponseError.GENERIC_ERROR
if response and response.status:
if status_count is not None:
status_count -= 1
cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status)
status = response.status
history = self.history + (
RequestHistory(method, url, error, status, redirect_location),
)
new_retry = self.new(
total=total,
connect=connect,
read=read,
redirect=redirect,
status=status_count,
other=other,
history=history,
)
if new_retry.is_exhausted():
reason = error or ResponseError(cause)
> raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]
E urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='localhost', port=8443): Max retries exceeded with url: /hps/jms/api/v1/storage?fields=all (Caused by ResponseError('too many 503 error responses'))
.tox/py312-coverage/lib/python3.12/site-packages/urllib3/util/retry.py:515: MaxRetryError
During handling of the above exception, another exception occurred:
client = <ansys.hps.client.client.Client object at 0x7f515e43da60>
def test_unavailable_fs_url(client):
> storage_config = JmsApi(client).get_storage()
tests/jms/test_jms_api.py:59:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/py312-coverage/lib/python3.12/site-packages/ansys/hps/client/jms/api/jms_api.py:278: in get_storage
return _get_storages(self.client, self.url)
.tox/py312-coverage/lib/python3.12/site-packages/ansys/hps/client/jms/api/jms_api.py:462: in _get_storages
r = client.session.get(url)
.tox/py312-coverage/lib/python3.12/site-packages/requests/sessions.py:602: in get
return self.request("GET", url, **kwargs)
.tox/py312-coverage/lib/python3.12/site-packages/requests/sessions.py:589: in request
resp = self.send(prep, **send_kwargs)
.tox/py312-coverage/lib/python3.12/site-packages/requests/sessions.py:703: in send
r = adapter.send(request, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <requests.adapters.HTTPAdapter object at 0x7f515e43df40>
request = <PreparedRequest [GET]>, stream = False
timeout = Timeout(connect=None, read=None, total=None), verify = False
cert = None, proxies = OrderedDict()
def send(
self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None
):
"""Sends PreparedRequest object. Returns Response object.
:param request: The :class:`PreparedRequest <PreparedRequest>` being sent.
:param stream: (optional) Whether to stream the request content.
:param timeout: (optional) How long to wait for the server to send
data before giving up, as a float, or a :ref:`(connect timeout,
read timeout) <timeouts>` tuple.
:type timeout: float or tuple or urllib3 Timeout object
:param verify: (optional) Either a boolean, in which case it controls whether
we verify the server's TLS certificate, or a string, in which case it
must be a path to a CA bundle to use
:param cert: (optional) Any user-provided SSL certificate to be trusted.
:param proxies: (optional) The proxies dictionary to apply to the request.
:rtype: requests.Response
"""
try:
conn = self.get_connection(request.url, proxies)
except LocationValueError as e:
raise InvalidURL(e, request=request)
self.cert_verify(conn, request.url, verify, cert)
url = self.request_url(request, proxies)
self.add_headers(
request,
stream=stream,
timeout=timeout,
verify=verify,
cert=cert,
proxies=proxies,
)
chunked = not (request.body is None or "Content-Length" in request.headers)
if isinstance(timeout, tuple):
try:
connect, read = timeout
timeout = TimeoutSauce(connect=connect, read=read)
except ValueError:
raise ValueError(
f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, "
f"or a single float to set both timeouts to the same value."
)
elif isinstance(timeout, TimeoutSauce):
pass
else:
timeout = TimeoutSauce(connect=timeout, read=timeout)
try:
resp = conn.urlopen(
method=request.method,
url=url,
body=request.body,
headers=request.headers,
redirect=False,
assert_same_host=False,
preload_content=False,
decode_content=False,
retries=self.max_retries,
timeout=timeout,
chunked=chunked,
)
except (ProtocolError, OSError) as err:
raise ConnectionError(err, request=request)
except MaxRetryError as e:
if isinstance(e.reason, ConnectTimeoutError):
# TODO: Remove this in 3.0.0: see #2811
if not isinstance(e.reason, NewConnectionError):
raise ConnectTimeout(e, request=request)
if isinstance(e.reason, ResponseError):
> raise RetryError(e, request=request)
E requests.exceptions.RetryError: HTTPSConnectionPool(host='localhost', port=8443): Max retries exceeded with url: /hps/jms/api/v1/storage?fields=all (Caused by ResponseError('too many 503 error responses'))
.tox/py312-coverage/lib/python3.12/site-packages/requests/adapters.py:510: RetryError
Check failure on line 79 in tests/jms/test_jms_api.py
github-actions / Test Report ubuntu-latest:3.12
test_jms_api
requests.exceptions.RetryError: HTTPSConnectionPool(host='localhost', port=8443): Max retries exceeded with url: /hps/jms/api/v1/projects?fields=all&name=Mapdl+Motorbike+Frame&sort=-creation_time&limit=1 (Caused by ResponseError('too many 503 error responses'))
Raw output
urllib3.exceptions.ResponseError: too many 503 error responses
The above exception was the direct cause of the following exception:
self = <requests.adapters.HTTPAdapter object at 0x7f515e43df40>
request = <PreparedRequest [GET]>, stream = False
timeout = Timeout(connect=None, read=None, total=None), verify = False
cert = None, proxies = OrderedDict()
def send(
self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None
):
"""Sends PreparedRequest object. Returns Response object.
:param request: The :class:`PreparedRequest <PreparedRequest>` being sent.
:param stream: (optional) Whether to stream the request content.
:param timeout: (optional) How long to wait for the server to send
data before giving up, as a float, or a :ref:`(connect timeout,
read timeout) <timeouts>` tuple.
:type timeout: float or tuple or urllib3 Timeout object
:param verify: (optional) Either a boolean, in which case it controls whether
we verify the server's TLS certificate, or a string, in which case it
must be a path to a CA bundle to use
:param cert: (optional) Any user-provided SSL certificate to be trusted.
:param proxies: (optional) The proxies dictionary to apply to the request.
:rtype: requests.Response
"""
try:
conn = self.get_connection(request.url, proxies)
except LocationValueError as e:
raise InvalidURL(e, request=request)
self.cert_verify(conn, request.url, verify, cert)
url = self.request_url(request, proxies)
self.add_headers(
request,
stream=stream,
timeout=timeout,
verify=verify,
cert=cert,
proxies=proxies,
)
chunked = not (request.body is None or "Content-Length" in request.headers)
if isinstance(timeout, tuple):
try:
connect, read = timeout
timeout = TimeoutSauce(connect=connect, read=read)
except ValueError:
raise ValueError(
f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, "
f"or a single float to set both timeouts to the same value."
)
elif isinstance(timeout, TimeoutSauce):
pass
else:
timeout = TimeoutSauce(connect=timeout, read=timeout)
try:
> resp = conn.urlopen(
method=request.method,
url=url,
body=request.body,
headers=request.headers,
redirect=False,
assert_same_host=False,
preload_content=False,
decode_content=False,
retries=self.max_retries,
timeout=timeout,
chunked=chunked,
)
.tox/py312-coverage/lib/python3.12/site-packages/requests/adapters.py:486:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/py312-coverage/lib/python3.12/site-packages/urllib3/connectionpool.py:948: in urlopen
return self.urlopen(
.tox/py312-coverage/lib/python3.12/site-packages/urllib3/connectionpool.py:948: in urlopen
return self.urlopen(
.tox/py312-coverage/lib/python3.12/site-packages/urllib3/connectionpool.py:948: in urlopen
return self.urlopen(
.tox/py312-coverage/lib/python3.12/site-packages/urllib3/connectionpool.py:948: in urlopen
return self.urlopen(
.tox/py312-coverage/lib/python3.12/site-packages/urllib3/connectionpool.py:948: in urlopen
return self.urlopen(
.tox/py312-coverage/lib/python3.12/site-packages/urllib3/connectionpool.py:938: in urlopen
retries = retries.increment(method, url, response=response, _pool=self)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = Retry(total=0, connect=None, read=None, redirect=None, status=None)
method = 'GET'
url = '/hps/jms/api/v1/projects?fields=all&name=Mapdl+Motorbike+Frame&sort=-creation_time&limit=1'
response = <urllib3.response.HTTPResponse object at 0x7f515e367a30>
error = None
_pool = <urllib3.connectionpool.HTTPSConnectionPool object at 0x7f515e4d54f0>
_stacktrace = None
def increment(
self,
method: str | None = None,
url: str | None = None,
response: BaseHTTPResponse | None = None,
error: Exception | None = None,
_pool: ConnectionPool | None = None,
_stacktrace: TracebackType | None = None,
) -> Retry:
"""Return a new Retry object with incremented retry counters.
:param response: A response object, or None, if the server did not
return a response.
:type response: :class:`~urllib3.response.BaseHTTPResponse`
:param Exception error: An error encountered during the request, or
None if the response was received successfully.
:return: A new ``Retry`` object.
"""
if self.total is False and error:
# Disabled, indicate to re-raise the error.
raise reraise(type(error), error, _stacktrace)
total = self.total
if total is not None:
total -= 1
connect = self.connect
read = self.read
redirect = self.redirect
status_count = self.status
other = self.other
cause = "unknown"
status = None
redirect_location = None
if error and self._is_connection_error(error):
# Connect retry?
if connect is False:
raise reraise(type(error), error, _stacktrace)
elif connect is not None:
connect -= 1
elif error and self._is_read_error(error):
# Read retry?
if read is False or method is None or not self._is_method_retryable(method):
raise reraise(type(error), error, _stacktrace)
elif read is not None:
read -= 1
elif error:
# Other retry?
if other is not None:
other -= 1
elif response and response.get_redirect_location():
# Redirect retry?
if redirect is not None:
redirect -= 1
cause = "too many redirects"
response_redirect_location = response.get_redirect_location()
if response_redirect_location:
redirect_location = response_redirect_location
status = response.status
else:
# Incrementing because of a server error like a 500 in
# status_forcelist and the given method is in the allowed_methods
cause = ResponseError.GENERIC_ERROR
if response and response.status:
if status_count is not None:
status_count -= 1
cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status)
status = response.status
history = self.history + (
RequestHistory(method, url, error, status, redirect_location),
)
new_retry = self.new(
total=total,
connect=connect,
read=read,
redirect=redirect,
status=status_count,
other=other,
history=history,
)
if new_retry.is_exhausted():
reason = error or ResponseError(cause)
> raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]
E urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='localhost', port=8443): Max retries exceeded with url: /hps/jms/api/v1/projects?fields=all&name=Mapdl+Motorbike+Frame&sort=-creation_time&limit=1 (Caused by ResponseError('too many 503 error responses'))
.tox/py312-coverage/lib/python3.12/site-packages/urllib3/util/retry.py:515: MaxRetryError
During handling of the above exception, another exception occurred:
client = <ansys.hps.client.client.Client object at 0x7f515e43da60>
def test_jms_api(client):
log.debug("=== Client ===")
proj_name = "Mapdl Motorbike Frame"
log.debug("=== Projects ===")
jms_api = JmsApi(client)
> project = jms_api.get_project_by_name(name=proj_name)
tests/jms/test_jms_api.py:79:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/py312-coverage/lib/python3.12/site-packages/ansys/hps/client/jms/api/jms_api.py:116: in get_project_by_name
return get_project_by_name(self.client, self.url, name, last_created)
.tox/py312-coverage/lib/python3.12/site-packages/ansys/hps/client/jms/api/jms_api.py:320: in get_project_by_name
projects = get_projects(client, api_url, **params)
.tox/py312-coverage/lib/python3.12/site-packages/ansys/hps/client/jms/api/jms_api.py:286: in get_projects
r = client.session.get(url, params=query_params)
.tox/py312-coverage/lib/python3.12/site-packages/requests/sessions.py:602: in get
return self.request("GET", url, **kwargs)
.tox/py312-coverage/lib/python3.12/site-packages/requests/sessions.py:589: in request
resp = self.send(prep, **send_kwargs)
.tox/py312-coverage/lib/python3.12/site-packages/requests/sessions.py:703: in send
r = adapter.send(request, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <requests.adapters.HTTPAdapter object at 0x7f515e43df40>
request = <PreparedRequest [GET]>, stream = False
timeout = Timeout(connect=None, read=None, total=None), verify = False
cert = None, proxies = OrderedDict()
def send(
self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None
):
"""Sends PreparedRequest object. Returns Response object.
:param request: The :class:`PreparedRequest <PreparedRequest>` being sent.
:param stream: (optional) Whether to stream the request content.
:param timeout: (optional) How long to wait for the server to send
data before giving up, as a float, or a :ref:`(connect timeout,
read timeout) <timeouts>` tuple.
:type timeout: float or tuple or urllib3 Timeout object
:param verify: (optional) Either a boolean, in which case it controls whether
we verify the server's TLS certificate, or a string, in which case it
must be a path to a CA bundle to use
:param cert: (optional) Any user-provided SSL certificate to be trusted.
:param proxies: (optional) The proxies dictionary to apply to the request.
:rtype: requests.Response
"""
try:
conn = self.get_connection(request.url, proxies)
except LocationValueError as e:
raise InvalidURL(e, request=request)
self.cert_verify(conn, request.url, verify, cert)
url = self.request_url(request, proxies)
self.add_headers(
request,
stream=stream,
timeout=timeout,
verify=verify,
cert=cert,
proxies=proxies,
)
chunked = not (request.body is None or "Content-Length" in request.headers)
if isinstance(timeout, tuple):
try:
connect, read = timeout
timeout = TimeoutSauce(connect=connect, read=read)
except ValueError:
raise ValueError(
f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, "
f"or a single float to set both timeouts to the same value."
)
elif isinstance(timeout, TimeoutSauce):
pass
else:
timeout = TimeoutSauce(connect=timeout, read=timeout)
try:
resp = conn.urlopen(
method=request.method,
url=url,
body=request.body,
headers=request.headers,
redirect=False,
assert_same_host=False,
preload_content=False,
decode_content=False,
retries=self.max_retries,
timeout=timeout,
chunked=chunked,
)
except (ProtocolError, OSError) as err:
raise ConnectionError(err, request=request)
except MaxRetryError as e:
if isinstance(e.reason, ConnectTimeoutError):
# TODO: Remove this in 3.0.0: see #2811
if not isinstance(e.reason, NewConnectionError):
raise ConnectTimeout(e, request=request)
if isinstance(e.reason, ResponseError):
> raise RetryError(e, request=request)
E requests.exceptions.RetryError: HTTPSConnectionPool(host='localhost', port=8443): Max retries exceeded with url: /hps/jms/api/v1/projects?fields=all&name=Mapdl+Motorbike+Frame&sort=-creation_time&limit=1 (Caused by ResponseError('too many 503 error responses'))
.tox/py312-coverage/lib/python3.12/site-packages/requests/adapters.py:510: RetryError
Check failure on line 134 in tests/jms/test_jms_api.py
github-actions / Test Report ubuntu-latest:3.12
test_jms_api.test_fields_query_parameter
ansys.hps.client.exceptions.APIError: 503 Server Error: Service Unavailable for: POST https://localhost:8443/hps/jms/api/v1/projects/
Raw output
url = 'https://localhost:8443/hps', username = 'repadmin', password = 'repadmin'
def test_fields_query_parameter(url, username, password):
client1 = Client(url, username, password, all_fields=False)
proj_name = "test_fields_query_parameter"
> project = create_project(client1, proj_name, num_jobs=2, use_exec_script=False)
tests/jms/test_jms_api.py:134:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
examples/mapdl_motorbike_frame/project_setup.py:73: in create_project
proj = jms_api.create_project(proj, replace=True)
.tox/py312-coverage/lib/python3.12/site-packages/ansys/hps/client/jms/api/jms_api.py:120: in create_project
return create_project(self.client, self.url, project, replace, as_objects)
.tox/py312-coverage/lib/python3.12/site-packages/ansys/hps/client/jms/api/jms_api.py:334: in create_project
r = client.session.post(f"{url}", data=json_data)
.tox/py312-coverage/lib/python3.12/site-packages/requests/sessions.py:637: in post
return self.request("POST", url, data=data, json=json, **kwargs)
.tox/py312-coverage/lib/python3.12/site-packages/requests/sessions.py:589: in request
resp = self.send(prep, **send_kwargs)
.tox/py312-coverage/lib/python3.12/site-packages/requests/sessions.py:710: in send
r = dispatch_hook("response", hooks, r, **kwargs)
.tox/py312-coverage/lib/python3.12/site-packages/requests/hooks.py:30: in dispatch_hook
_hook_data = hook(hook_data, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
response = <Response [503]>, args = ()
kwargs = {'cert': None, 'proxies': OrderedDict(), 'stream': False, 'timeout': None, ...}
r_content = {}, reason = 'Service Unavailable', description = None
error_msg = '503 Server Error: Service Unavailable for: POST https://localhost:8443/hps/jms/api/v1/projects/'
def raise_for_status(response, *args, **kwargs):
"""Automatically checks HTTP errors.
This method mimics the requests.Response.raise_for_status() method.
"""
if 400 <= response.status_code < 600:
r_content = {}
try:
r_content = response.json()
except ValueError:
pass
reason = r_content.get("title", None) # jms api
if not reason:
reason = r_content.get("error", None) # auth api
if not reason:
reason = response.reason
description = r_content.get("description", None) # jms api
if not description:
description = r_content.get("error_description", None) # auth api
if 400 <= response.status_code < 500:
error_msg = "%s Client Error: %s for: %s %s" % (
response.status_code,
reason,
response.request.method,
response.url,
)
if description:
error_msg += f"\n{description}"
raise ClientError(error_msg, reason=reason, description=description, response=response)
elif 500 <= response.status_code < 600:
error_msg = "%s Server Error: %s for: %s %s" % (
response.status_code,
reason,
response.request.method,
response.url,
)
if description:
error_msg += f"\n{description}"
> raise APIError(error_msg, reason=reason, description=description, response=response)
E ansys.hps.client.exceptions.APIError: 503 Server Error: Service Unavailable for: POST https://localhost:8443/hps/jms/api/v1/projects/
.tox/py312-coverage/lib/python3.12/site-packages/ansys/hps/client/exceptions.py:108: APIError
Check failure on line 176 in tests/jms/test_jms_api.py
github-actions / Test Report ubuntu-latest:3.12
test_jms_api.test_storage_configuration
requests.exceptions.RetryError: HTTPSConnectionPool(host='localhost', port=8443): Max retries exceeded with url: /hps/jms/api/v1/storage?fields=all (Caused by ResponseError('too many 503 error responses'))
Raw output
urllib3.exceptions.ResponseError: too many 503 error responses
The above exception was the direct cause of the following exception:
self = <requests.adapters.HTTPAdapter object at 0x7f515e43df40>
request = <PreparedRequest [GET]>, stream = False
timeout = Timeout(connect=None, read=None, total=None), verify = False
cert = None, proxies = OrderedDict()
def send(
self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None
):
"""Sends PreparedRequest object. Returns Response object.
:param request: The :class:`PreparedRequest <PreparedRequest>` being sent.
:param stream: (optional) Whether to stream the request content.
:param timeout: (optional) How long to wait for the server to send
data before giving up, as a float, or a :ref:`(connect timeout,
read timeout) <timeouts>` tuple.
:type timeout: float or tuple or urllib3 Timeout object
:param verify: (optional) Either a boolean, in which case it controls whether
we verify the server's TLS certificate, or a string, in which case it
must be a path to a CA bundle to use
:param cert: (optional) Any user-provided SSL certificate to be trusted.
:param proxies: (optional) The proxies dictionary to apply to the request.
:rtype: requests.Response
"""
try:
conn = self.get_connection(request.url, proxies)
except LocationValueError as e:
raise InvalidURL(e, request=request)
self.cert_verify(conn, request.url, verify, cert)
url = self.request_url(request, proxies)
self.add_headers(
request,
stream=stream,
timeout=timeout,
verify=verify,
cert=cert,
proxies=proxies,
)
chunked = not (request.body is None or "Content-Length" in request.headers)
if isinstance(timeout, tuple):
try:
connect, read = timeout
timeout = TimeoutSauce(connect=connect, read=read)
except ValueError:
raise ValueError(
f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, "
f"or a single float to set both timeouts to the same value."
)
elif isinstance(timeout, TimeoutSauce):
pass
else:
timeout = TimeoutSauce(connect=timeout, read=timeout)
try:
> resp = conn.urlopen(
method=request.method,
url=url,
body=request.body,
headers=request.headers,
redirect=False,
assert_same_host=False,
preload_content=False,
decode_content=False,
retries=self.max_retries,
timeout=timeout,
chunked=chunked,
)
.tox/py312-coverage/lib/python3.12/site-packages/requests/adapters.py:486:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/py312-coverage/lib/python3.12/site-packages/urllib3/connectionpool.py:948: in urlopen
return self.urlopen(
.tox/py312-coverage/lib/python3.12/site-packages/urllib3/connectionpool.py:948: in urlopen
return self.urlopen(
.tox/py312-coverage/lib/python3.12/site-packages/urllib3/connectionpool.py:948: in urlopen
return self.urlopen(
.tox/py312-coverage/lib/python3.12/site-packages/urllib3/connectionpool.py:948: in urlopen
return self.urlopen(
.tox/py312-coverage/lib/python3.12/site-packages/urllib3/connectionpool.py:948: in urlopen
return self.urlopen(
.tox/py312-coverage/lib/python3.12/site-packages/urllib3/connectionpool.py:938: in urlopen
retries = retries.increment(method, url, response=response, _pool=self)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = Retry(total=0, connect=None, read=None, redirect=None, status=None)
method = 'GET', url = '/hps/jms/api/v1/storage?fields=all'
response = <urllib3.response.HTTPResponse object at 0x7f515e367a90>
error = None
_pool = <urllib3.connectionpool.HTTPSConnectionPool object at 0x7f515e4d54f0>
_stacktrace = None
def increment(
self,
method: str | None = None,
url: str | None = None,
response: BaseHTTPResponse | None = None,
error: Exception | None = None,
_pool: ConnectionPool | None = None,
_stacktrace: TracebackType | None = None,
) -> Retry:
"""Return a new Retry object with incremented retry counters.
:param response: A response object, or None, if the server did not
return a response.
:type response: :class:`~urllib3.response.BaseHTTPResponse`
:param Exception error: An error encountered during the request, or
None if the response was received successfully.
:return: A new ``Retry`` object.
"""
if self.total is False and error:
# Disabled, indicate to re-raise the error.
raise reraise(type(error), error, _stacktrace)
total = self.total
if total is not None:
total -= 1
connect = self.connect
read = self.read
redirect = self.redirect
status_count = self.status
other = self.other
cause = "unknown"
status = None
redirect_location = None
if error and self._is_connection_error(error):
# Connect retry?
if connect is False:
raise reraise(type(error), error, _stacktrace)
elif connect is not None:
connect -= 1
elif error and self._is_read_error(error):
# Read retry?
if read is False or method is None or not self._is_method_retryable(method):
raise reraise(type(error), error, _stacktrace)
elif read is not None:
read -= 1
elif error:
# Other retry?
if other is not None:
other -= 1
elif response and response.get_redirect_location():
# Redirect retry?
if redirect is not None:
redirect -= 1
cause = "too many redirects"
response_redirect_location = response.get_redirect_location()
if response_redirect_location:
redirect_location = response_redirect_location
status = response.status
else:
# Incrementing because of a server error like a 500 in
# status_forcelist and the given method is in the allowed_methods
cause = ResponseError.GENERIC_ERROR
if response and response.status:
if status_count is not None:
status_count -= 1
cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status)
status = response.status
history = self.history + (
RequestHistory(method, url, error, status, redirect_location),
)
new_retry = self.new(
total=total,
connect=connect,
read=read,
redirect=redirect,
status=status_count,
other=other,
history=history,
)
if new_retry.is_exhausted():
reason = error or ResponseError(cause)
> raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]
E urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='localhost', port=8443): Max retries exceeded with url: /hps/jms/api/v1/storage?fields=all (Caused by ResponseError('too many 503 error responses'))
.tox/py312-coverage/lib/python3.12/site-packages/urllib3/util/retry.py:515: MaxRetryError
During handling of the above exception, another exception occurred:
client = <ansys.hps.client.client.Client object at 0x7f515e43da60>
def test_storage_configuration(client):
jms_api = JmsApi(client)
> storages = jms_api.get_storage()
tests/jms/test_jms_api.py:176:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/py312-coverage/lib/python3.12/site-packages/ansys/hps/client/jms/api/jms_api.py:278: in get_storage
return _get_storages(self.client, self.url)
.tox/py312-coverage/lib/python3.12/site-packages/ansys/hps/client/jms/api/jms_api.py:462: in _get_storages
r = client.session.get(url)
.tox/py312-coverage/lib/python3.12/site-packages/requests/sessions.py:602: in get
return self.request("GET", url, **kwargs)
.tox/py312-coverage/lib/python3.12/site-packages/requests/sessions.py:589: in request
resp = self.send(prep, **send_kwargs)
.tox/py312-coverage/lib/python3.12/site-packages/requests/sessions.py:703: in send
r = adapter.send(request, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <requests.adapters.HTTPAdapter object at 0x7f515e43df40>
request = <PreparedRequest [GET]>, stream = False
timeout = Timeout(connect=None, read=None, total=None), verify = False
cert = None, proxies = OrderedDict()
def send(
self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None
):
"""Sends PreparedRequest object. Returns Response object.
:param request: The :class:`PreparedRequest <PreparedRequest>` being sent.
:param stream: (optional) Whether to stream the request content.
:param timeout: (optional) How long to wait for the server to send
data before giving up, as a float, or a :ref:`(connect timeout,
read timeout) <timeouts>` tuple.
:type timeout: float or tuple or urllib3 Timeout object
:param verify: (optional) Either a boolean, in which case it controls whether
we verify the server's TLS certificate, or a string, in which case it
must be a path to a CA bundle to use
:param cert: (optional) Any user-provided SSL certificate to be trusted.
:param proxies: (optional) The proxies dictionary to apply to the request.
:rtype: requests.Response
"""
try:
conn = self.get_connection(request.url, proxies)
except LocationValueError as e:
raise InvalidURL(e, request=request)
self.cert_verify(conn, request.url, verify, cert)
url = self.request_url(request, proxies)
self.add_headers(
request,
stream=stream,
timeout=timeout,
verify=verify,
cert=cert,
proxies=proxies,
)
chunked = not (request.body is None or "Content-Length" in request.headers)
if isinstance(timeout, tuple):
try:
connect, read = timeout
timeout = TimeoutSauce(connect=connect, read=read)
except ValueError:
raise ValueError(
f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, "
f"or a single float to set both timeouts to the same value."
)
elif isinstance(timeout, TimeoutSauce):
pass
else:
timeout = TimeoutSauce(connect=timeout, read=timeout)
try:
resp = conn.urlopen(
method=request.method,
url=url,
body=request.body,
headers=request.headers,
redirect=False,
assert_same_host=False,
preload_content=False,
decode_content=False,
retries=self.max_retries,
timeout=timeout,
chunked=chunked,
)
except (ProtocolError, OSError) as err:
raise ConnectionError(err, request=request)
except MaxRetryError as e:
if isinstance(e.reason, ConnectTimeoutError):
# TODO: Remove this in 3.0.0: see #2811
if not isinstance(e.reason, NewConnectionError):
raise ConnectTimeout(e, request=request)
if isinstance(e.reason, ResponseError):
> raise RetryError(e, request=request)
E requests.exceptions.RetryError: HTTPSConnectionPool(host='localhost', port=8443): Max retries exceeded with url: /hps/jms/api/v1/storage?fields=all (Caused by ResponseError('too many 503 error responses'))
.tox/py312-coverage/lib/python3.12/site-packages/requests/adapters.py:510: RetryError
Check failure on line 198 in tests/jms/test_jms_api.py
github-actions / Test Report ubuntu-latest:3.12
test_jms_api.test_objects_type_check
ansys.hps.client.exceptions.APIError: 503 Server Error: Service Unavailable for: POST https://localhost:8443/hps/jms/api/v1/projects/?fields=all
Raw output
client = <ansys.hps.client.client.Client object at 0x7f515e43da60>
def test_objects_type_check(client):
proj_name = f"test_objects_type_check"
proj = Project(name=proj_name, active=True)
job_def = JobDefinition(name="Job Def", active=True)
job = Job(name="test")
jms_api = JmsApi(client)
with pytest.raises(ClientError) as ex_info:
_ = jms_api.create_task_definition_templates([job])
assert "Wrong object type" in str(ex_info.value)
assert "got <class 'ansys.hps.client.jms.resource.job.Job'>" in str(ex_info.value)
> proj = jms_api.create_project(proj, replace=True)
tests/jms/test_jms_api.py:198:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/py312-coverage/lib/python3.12/site-packages/ansys/hps/client/jms/api/jms_api.py:120: in create_project
return create_project(self.client, self.url, project, replace, as_objects)
.tox/py312-coverage/lib/python3.12/site-packages/ansys/hps/client/jms/api/jms_api.py:334: in create_project
r = client.session.post(f"{url}", data=json_data)
.tox/py312-coverage/lib/python3.12/site-packages/requests/sessions.py:637: in post
return self.request("POST", url, data=data, json=json, **kwargs)
.tox/py312-coverage/lib/python3.12/site-packages/requests/sessions.py:589: in request
resp = self.send(prep, **send_kwargs)
.tox/py312-coverage/lib/python3.12/site-packages/requests/sessions.py:710: in send
r = dispatch_hook("response", hooks, r, **kwargs)
.tox/py312-coverage/lib/python3.12/site-packages/requests/hooks.py:30: in dispatch_hook
_hook_data = hook(hook_data, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
response = <Response [503]>, args = ()
kwargs = {'cert': None, 'proxies': OrderedDict(), 'stream': False, 'timeout': None, ...}
r_content = {}, reason = 'Service Unavailable', description = None
error_msg = '503 Server Error: Service Unavailable for: POST https://localhost:8443/hps/jms/api/v1/projects/?fields=all'
def raise_for_status(response, *args, **kwargs):
"""Automatically checks HTTP errors.
This method mimics the requests.Response.raise_for_status() method.
"""
if 400 <= response.status_code < 600:
r_content = {}
try:
r_content = response.json()
except ValueError:
pass
reason = r_content.get("title", None) # jms api
if not reason:
reason = r_content.get("error", None) # auth api
if not reason:
reason = response.reason
description = r_content.get("description", None) # jms api
if not description:
description = r_content.get("error_description", None) # auth api
if 400 <= response.status_code < 500:
error_msg = "%s Client Error: %s for: %s %s" % (
response.status_code,
reason,
response.request.method,
response.url,
)
if description:
error_msg += f"\n{description}"
raise ClientError(error_msg, reason=reason, description=description, response=response)
elif 500 <= response.status_code < 600:
error_msg = "%s Server Error: %s for: %s %s" % (
response.status_code,
reason,
response.request.method,
response.url,
)
if description:
error_msg += f"\n{description}"
> raise APIError(error_msg, reason=reason, description=description, response=response)
E ansys.hps.client.exceptions.APIError: 503 Server Error: Service Unavailable for: POST https://localhost:8443/hps/jms/api/v1/projects/?fields=all
.tox/py312-coverage/lib/python3.12/site-packages/ansys/hps/client/exceptions.py:108: APIError
Check failure on line 45 in tests/jms/test_job_definitions.py
github-actions / Test Report ubuntu-latest:3.12
test_job_definitions.test_job_definition_delete
ansys.hps.client.exceptions.APIError: 503 Server Error: Service Unavailable for: POST https://localhost:8443/hps/jms/api/v1/projects/?fields=all
Raw output
client = <ansys.hps.client.client.Client object at 0x7f515e43da60>
def test_job_definition_delete(client):
proj_name = f"rep_client_test_jms_JobDefinitionTest"
proj = Project(name=proj_name, active=True)
jms_api = JmsApi(client)
> proj = jms_api.create_project(proj, replace=True)
tests/jms/test_job_definitions.py:45:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/py312-coverage/lib/python3.12/site-packages/ansys/hps/client/jms/api/jms_api.py:120: in create_project
return create_project(self.client, self.url, project, replace, as_objects)
.tox/py312-coverage/lib/python3.12/site-packages/ansys/hps/client/jms/api/jms_api.py:334: in create_project
r = client.session.post(f"{url}", data=json_data)
.tox/py312-coverage/lib/python3.12/site-packages/requests/sessions.py:637: in post
return self.request("POST", url, data=data, json=json, **kwargs)
.tox/py312-coverage/lib/python3.12/site-packages/requests/sessions.py:589: in request
resp = self.send(prep, **send_kwargs)
.tox/py312-coverage/lib/python3.12/site-packages/requests/sessions.py:710: in send
r = dispatch_hook("response", hooks, r, **kwargs)
.tox/py312-coverage/lib/python3.12/site-packages/requests/hooks.py:30: in dispatch_hook
_hook_data = hook(hook_data, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
response = <Response [503]>, args = ()
kwargs = {'cert': None, 'proxies': OrderedDict(), 'stream': False, 'timeout': None, ...}
r_content = {}, reason = 'Service Unavailable', description = None
error_msg = '503 Server Error: Service Unavailable for: POST https://localhost:8443/hps/jms/api/v1/projects/?fields=all'
def raise_for_status(response, *args, **kwargs):
"""Automatically checks HTTP errors.
This method mimics the requests.Response.raise_for_status() method.
"""
if 400 <= response.status_code < 600:
r_content = {}
try:
r_content = response.json()
except ValueError:
pass
reason = r_content.get("title", None) # jms api
if not reason:
reason = r_content.get("error", None) # auth api
if not reason:
reason = response.reason
description = r_content.get("description", None) # jms api
if not description:
description = r_content.get("error_description", None) # auth api
if 400 <= response.status_code < 500:
error_msg = "%s Client Error: %s for: %s %s" % (
response.status_code,
reason,
response.request.method,
response.url,
)
if description:
error_msg += f"\n{description}"
raise ClientError(error_msg, reason=reason, description=description, response=response)
elif 500 <= response.status_code < 600:
error_msg = "%s Server Error: %s for: %s %s" % (
response.status_code,
reason,
response.request.method,
response.url,
)
if description:
error_msg += f"\n{description}"
> raise APIError(error_msg, reason=reason, description=description, response=response)
E ansys.hps.client.exceptions.APIError: 503 Server Error: Service Unavailable for: POST https://localhost:8443/hps/jms/api/v1/projects/?fields=all
.tox/py312-coverage/lib/python3.12/site-packages/ansys/hps/client/exceptions.py:108: APIError
Check failure on line 70 in tests/jms/test_job_definitions.py
github-actions / Test Report ubuntu-latest:3.12
test_job_definitions.test_task_definition_fields
ansys.hps.client.exceptions.APIError: 503 Server Error: Service Unavailable for: POST https://localhost:8443/hps/jms/api/v1/projects/?fields=all
Raw output
client = <ansys.hps.client.client.Client object at 0x7f515e43da60>
def test_task_definition_fields(client):
# verify that:
# - store_output is defaulted to True when undefined,
# - memory and disk_space are correctly stored in bytes
jms_api = JmsApi(client)
proj_name = f"test_store_output"
project = Project(name=proj_name, active=False, priority=10)
> project = jms_api.create_project(project)
tests/jms/test_job_definitions.py:70:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/py312-coverage/lib/python3.12/site-packages/ansys/hps/client/jms/api/jms_api.py:120: in create_project
return create_project(self.client, self.url, project, replace, as_objects)
.tox/py312-coverage/lib/python3.12/site-packages/ansys/hps/client/jms/api/jms_api.py:334: in create_project
r = client.session.post(f"{url}", data=json_data)
.tox/py312-coverage/lib/python3.12/site-packages/requests/sessions.py:637: in post
return self.request("POST", url, data=data, json=json, **kwargs)
.tox/py312-coverage/lib/python3.12/site-packages/requests/sessions.py:589: in request
resp = self.send(prep, **send_kwargs)
.tox/py312-coverage/lib/python3.12/site-packages/requests/sessions.py:710: in send
r = dispatch_hook("response", hooks, r, **kwargs)
.tox/py312-coverage/lib/python3.12/site-packages/requests/hooks.py:30: in dispatch_hook
_hook_data = hook(hook_data, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
response = <Response [503]>, args = ()
kwargs = {'cert': None, 'proxies': OrderedDict(), 'stream': False, 'timeout': None, ...}
r_content = {}, reason = 'Service Unavailable', description = None
error_msg = '503 Server Error: Service Unavailable for: POST https://localhost:8443/hps/jms/api/v1/projects/?fields=all'
def raise_for_status(response, *args, **kwargs):
"""Automatically checks HTTP errors.
This method mimics the requests.Response.raise_for_status() method.
"""
if 400 <= response.status_code < 600:
r_content = {}
try:
r_content = response.json()
except ValueError:
pass
reason = r_content.get("title", None) # jms api
if not reason:
reason = r_content.get("error", None) # auth api
if not reason:
reason = response.reason
description = r_content.get("description", None) # jms api
if not description:
description = r_content.get("error_description", None) # auth api
if 400 <= response.status_code < 500:
error_msg = "%s Client Error: %s for: %s %s" % (
response.status_code,
reason,
response.request.method,
response.url,
)
if description:
error_msg += f"\n{description}"
raise ClientError(error_msg, reason=reason, description=description, response=response)
elif 500 <= response.status_code < 600:
error_msg = "%s Server Error: %s for: %s %s" % (
response.status_code,
reason,
response.request.method,
response.url,
)
if description:
error_msg += f"\n{description}"
> raise APIError(error_msg, reason=reason, description=description, response=response)
E ansys.hps.client.exceptions.APIError: 503 Server Error: Service Unavailable for: POST https://localhost:8443/hps/jms/api/v1/projects/?fields=all
.tox/py312-coverage/lib/python3.12/site-packages/ansys/hps/client/exceptions.py:108: APIError
Check failure on line 104 in tests/jms/test_job_definitions.py
github-actions / Test Report ubuntu-latest:3.12
test_job_definitions.test_task_and_job_definition_copy
ansys.hps.client.exceptions.APIError: 503 Server Error: Service Unavailable for: POST https://localhost:8443/hps/jms/api/v1/projects/?fields=all
Raw output
client = <ansys.hps.client.client.Client object at 0x7f515e43da60>
def test_task_and_job_definition_copy(client):
# create new project
num_jobs = 1
> project = create_project(
client,
f"test_task_definition_copy",
num_jobs=num_jobs,
use_exec_script=False,
active=False,
)
tests/jms/test_job_definitions.py:104:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
examples/mapdl_motorbike_frame/project_setup.py:73: in create_project
proj = jms_api.create_project(proj, replace=True)
.tox/py312-coverage/lib/python3.12/site-packages/ansys/hps/client/jms/api/jms_api.py:120: in create_project
return create_project(self.client, self.url, project, replace, as_objects)
.tox/py312-coverage/lib/python3.12/site-packages/ansys/hps/client/jms/api/jms_api.py:334: in create_project
r = client.session.post(f"{url}", data=json_data)
.tox/py312-coverage/lib/python3.12/site-packages/requests/sessions.py:637: in post
return self.request("POST", url, data=data, json=json, **kwargs)
.tox/py312-coverage/lib/python3.12/site-packages/requests/sessions.py:589: in request
resp = self.send(prep, **send_kwargs)
.tox/py312-coverage/lib/python3.12/site-packages/requests/sessions.py:710: in send
r = dispatch_hook("response", hooks, r, **kwargs)
.tox/py312-coverage/lib/python3.12/site-packages/requests/hooks.py:30: in dispatch_hook
_hook_data = hook(hook_data, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
response = <Response [503]>, args = ()
kwargs = {'cert': None, 'proxies': OrderedDict(), 'stream': False, 'timeout': None, ...}
r_content = {}, reason = 'Service Unavailable', description = None
error_msg = '503 Server Error: Service Unavailable for: POST https://localhost:8443/hps/jms/api/v1/projects/?fields=all'
def raise_for_status(response, *args, **kwargs):
"""Automatically checks HTTP errors.
This method mimics the requests.Response.raise_for_status() method.
"""
if 400 <= response.status_code < 600:
r_content = {}
try:
r_content = response.json()
except ValueError:
pass
reason = r_content.get("title", None) # jms api
if not reason:
reason = r_content.get("error", None) # auth api
if not reason:
reason = response.reason
description = r_content.get("description", None) # jms api
if not description:
description = r_content.get("error_description", None) # auth api
if 400 <= response.status_code < 500:
error_msg = "%s Client Error: %s for: %s %s" % (
response.status_code,
reason,
response.request.method,
response.url,
)
if description:
error_msg += f"\n{description}"
raise ClientError(error_msg, reason=reason, description=description, response=response)
elif 500 <= response.status_code < 600:
error_msg = "%s Server Error: %s for: %s %s" % (
response.status_code,
reason,
response.request.method,
response.url,
)
if description:
error_msg += f"\n{description}"
> raise APIError(error_msg, reason=reason, description=description, response=response)
E ansys.hps.client.exceptions.APIError: 503 Server Error: Service Unavailable for: POST https://localhost:8443/hps/jms/api/v1/projects/?fields=all
.tox/py312-coverage/lib/python3.12/site-packages/ansys/hps/client/exceptions.py:108: APIError
Check failure on line 147 in tests/jms/test_jobs.py
github-actions / Test Report ubuntu-latest:3.12
test_jobs.test_job_integration
ansys.hps.client.exceptions.APIError: 503 Server Error: Service Unavailable for: POST https://localhost:8443/hps/jms/api/v1/projects/?fields=all
Raw output
client = <ansys.hps.client.client.Client object at 0x7f515e43da60>
def test_job_integration(client):
proj_name = f"test_jobs_JobTest"
proj = Project(name=proj_name, active=True)
jms_api = JmsApi(client)
> proj = jms_api.create_project(proj, replace=True)
tests/jms/test_jobs.py:147:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/py312-coverage/lib/python3.12/site-packages/ansys/hps/client/jms/api/jms_api.py:120: in create_project
return create_project(self.client, self.url, project, replace, as_objects)
.tox/py312-coverage/lib/python3.12/site-packages/ansys/hps/client/jms/api/jms_api.py:334: in create_project
r = client.session.post(f"{url}", data=json_data)
.tox/py312-coverage/lib/python3.12/site-packages/requests/sessions.py:637: in post
return self.request("POST", url, data=data, json=json, **kwargs)
.tox/py312-coverage/lib/python3.12/site-packages/requests/sessions.py:589: in request
resp = self.send(prep, **send_kwargs)
.tox/py312-coverage/lib/python3.12/site-packages/requests/sessions.py:710: in send
r = dispatch_hook("response", hooks, r, **kwargs)
.tox/py312-coverage/lib/python3.12/site-packages/requests/hooks.py:30: in dispatch_hook
_hook_data = hook(hook_data, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
response = <Response [503]>, args = ()
kwargs = {'cert': None, 'proxies': OrderedDict(), 'stream': False, 'timeout': None, ...}
r_content = {}, reason = 'Service Unavailable', description = None
error_msg = '503 Server Error: Service Unavailable for: POST https://localhost:8443/hps/jms/api/v1/projects/?fields=all'
def raise_for_status(response, *args, **kwargs):
"""Automatically checks HTTP errors.
This method mimics the requests.Response.raise_for_status() method.
"""
if 400 <= response.status_code < 600:
r_content = {}
try:
r_content = response.json()
except ValueError:
pass
reason = r_content.get("title", None) # jms api
if not reason:
reason = r_content.get("error", None) # auth api
if not reason:
reason = response.reason
description = r_content.get("description", None) # jms api
if not description:
description = r_content.get("error_description", None) # auth api
if 400 <= response.status_code < 500:
error_msg = "%s Client Error: %s for: %s %s" % (
response.status_code,
reason,
response.request.method,
response.url,
)
if description:
error_msg += f"\n{description}"
raise ClientError(error_msg, reason=reason, description=description, response=response)
elif 500 <= response.status_code < 600:
error_msg = "%s Server Error: %s for: %s %s" % (
response.status_code,
reason,
response.request.method,
response.url,
)
if description:
error_msg += f"\n{description}"
> raise APIError(error_msg, reason=reason, description=description, response=response)
E ansys.hps.client.exceptions.APIError: 503 Server Error: Service Unavailable for: POST https://localhost:8443/hps/jms/api/v1/projects/?fields=all
.tox/py312-coverage/lib/python3.12/site-packages/ansys/hps/client/exceptions.py:108: APIError
Check failure on line 234 in tests/jms/test_jobs.py
github-actions / Test Report ubuntu-latest:3.12
test_jobs.test_job_update
ansys.hps.client.exceptions.APIError: 503 Server Error: Service Unavailable for: POST https://localhost:8443/hps/jms/api/v1/projects/?fields=all
Raw output
client = <ansys.hps.client.client.Client object at 0x7f515e43da60>
def test_job_update(client):
jms_api = JmsApi(client)
proj_name = f"test_job_update_{uuid.uuid4().hex[:8]}"
> project = create_project(client=client, name=proj_name, num_jobs=2)
tests/jms/test_jobs.py:234:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
examples/mapdl_motorbike_frame/project_setup.py:73: in create_project
proj = jms_api.create_project(proj, replace=True)
.tox/py312-coverage/lib/python3.12/site-packages/ansys/hps/client/jms/api/jms_api.py:120: in create_project
return create_project(self.client, self.url, project, replace, as_objects)
.tox/py312-coverage/lib/python3.12/site-packages/ansys/hps/client/jms/api/jms_api.py:334: in create_project
r = client.session.post(f"{url}", data=json_data)
.tox/py312-coverage/lib/python3.12/site-packages/requests/sessions.py:637: in post
return self.request("POST", url, data=data, json=json, **kwargs)
.tox/py312-coverage/lib/python3.12/site-packages/requests/sessions.py:589: in request
resp = self.send(prep, **send_kwargs)
.tox/py312-coverage/lib/python3.12/site-packages/requests/sessions.py:710: in send
r = dispatch_hook("response", hooks, r, **kwargs)
.tox/py312-coverage/lib/python3.12/site-packages/requests/hooks.py:30: in dispatch_hook
_hook_data = hook(hook_data, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
response = <Response [503]>, args = ()
kwargs = {'cert': None, 'proxies': OrderedDict(), 'stream': False, 'timeout': None, ...}
r_content = {}, reason = 'Service Unavailable', description = None
error_msg = '503 Server Error: Service Unavailable for: POST https://localhost:8443/hps/jms/api/v1/projects/?fields=all'
def raise_for_status(response, *args, **kwargs):
"""Automatically checks HTTP errors.
This method mimics the requests.Response.raise_for_status() method.
"""
if 400 <= response.status_code < 600:
r_content = {}
try:
r_content = response.json()
except ValueError:
pass
reason = r_content.get("title", None) # jms api
if not reason:
reason = r_content.get("error", None) # auth api
if not reason:
reason = response.reason
description = r_content.get("description", None) # jms api
if not description:
description = r_content.get("error_description", None) # auth api
if 400 <= response.status_code < 500:
error_msg = "%s Client Error: %s for: %s %s" % (
response.status_code,
reason,
response.request.method,
response.url,
)
if description:
error_msg += f"\n{description}"
raise ClientError(error_msg, reason=reason, description=description, response=response)
elif 500 <= response.status_code < 600:
error_msg = "%s Server Error: %s for: %s %s" % (
response.status_code,
reason,
response.request.method,
response.url,
)
if description:
error_msg += f"\n{description}"
> raise APIError(error_msg, reason=reason, description=description, response=response)
E ansys.hps.client.exceptions.APIError: 503 Server Error: Service Unavailable for: POST https://localhost:8443/hps/jms/api/v1/projects/?fields=all
.tox/py312-coverage/lib/python3.12/site-packages/ansys/hps/client/exceptions.py:108: APIError
Check failure on line 186 in tests/jms/test_parameter_definitions.py
github-actions / Test Report ubuntu-latest:3.12
test_parameter_definitions.test_parameter_definition_integration
ansys.hps.client.exceptions.APIError: 503 Server Error: Service Unavailable for: POST https://localhost:8443/hps/jms/api/v1/projects/?fields=all
Raw output
client = <ansys.hps.client.client.Client object at 0x7f515e43da60>
def test_parameter_definition_integration(client):
proj_name = f"test_jms_ParameterDefinitionTest"
proj = Project(name=proj_name, active=True)
jms_api = JmsApi(client)
> proj = jms_api.create_project(proj, replace=True)
tests/jms/test_parameter_definitions.py:186:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/py312-coverage/lib/python3.12/site-packages/ansys/hps/client/jms/api/jms_api.py:120: in create_project
return create_project(self.client, self.url, project, replace, as_objects)
.tox/py312-coverage/lib/python3.12/site-packages/ansys/hps/client/jms/api/jms_api.py:334: in create_project
r = client.session.post(f"{url}", data=json_data)
.tox/py312-coverage/lib/python3.12/site-packages/requests/sessions.py:637: in post
return self.request("POST", url, data=data, json=json, **kwargs)
.tox/py312-coverage/lib/python3.12/site-packages/requests/sessions.py:589: in request
resp = self.send(prep, **send_kwargs)
.tox/py312-coverage/lib/python3.12/site-packages/requests/sessions.py:710: in send
r = dispatch_hook("response", hooks, r, **kwargs)
.tox/py312-coverage/lib/python3.12/site-packages/requests/hooks.py:30: in dispatch_hook
_hook_data = hook(hook_data, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
response = <Response [503]>, args = ()
kwargs = {'cert': None, 'proxies': OrderedDict(), 'stream': False, 'timeout': None, ...}
r_content = {}, reason = 'Service Unavailable', description = None
error_msg = '503 Server Error: Service Unavailable for: POST https://localhost:8443/hps/jms/api/v1/projects/?fields=all'
def raise_for_status(response, *args, **kwargs):
"""Automatically checks HTTP errors.
This method mimics the requests.Response.raise_for_status() method.
"""
if 400 <= response.status_code < 600:
r_content = {}
try:
r_content = response.json()
except ValueError:
pass
reason = r_content.get("title", None) # jms api
if not reason:
reason = r_content.get("error", None) # auth api
if not reason:
reason = response.reason
description = r_content.get("description", None) # jms api
if not description:
description = r_content.get("error_description", None) # auth api
if 400 <= response.status_code < 500:
error_msg = "%s Client Error: %s for: %s %s" % (
response.status_code,
reason,
response.request.method,
response.url,
)
if description:
error_msg += f"\n{description}"
raise ClientError(error_msg, reason=reason, description=description, response=response)
elif 500 <= response.status_code < 600:
error_msg = "%s Server Error: %s for: %s %s" % (
response.status_code,
reason,
response.request.method,
response.url,
)
if description:
error_msg += f"\n{description}"
> raise APIError(error_msg, reason=reason, description=description, response=response)
E ansys.hps.client.exceptions.APIError: 503 Server Error: Service Unavailable for: POST https://localhost:8443/hps/jms/api/v1/projects/?fields=all
.tox/py312-coverage/lib/python3.12/site-packages/ansys/hps/client/exceptions.py:108: APIError
Check failure on line 226 in tests/jms/test_parameter_definitions.py
github-actions / Test Report ubuntu-latest:3.12
test_parameter_definitions.test_mixed_parameter_definition
ansys.hps.client.exceptions.APIError: 503 Server Error: Service Unavailable for: POST https://localhost:8443/hps/jms/api/v1/projects/?fields=all
Raw output
client = <ansys.hps.client.client.Client object at 0x7f515e43da60>
def test_mixed_parameter_definition(client):
proj_name = f"test_mixed_parameter_definition"
proj = Project(name=proj_name, active=True)
jms_api = JmsApi(client)
> proj = jms_api.create_project(proj, replace=True)
tests/jms/test_parameter_definitions.py:226:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/py312-coverage/lib/python3.12/site-packages/ansys/hps/client/jms/api/jms_api.py:120: in create_project
return create_project(self.client, self.url, project, replace, as_objects)
.tox/py312-coverage/lib/python3.12/site-packages/ansys/hps/client/jms/api/jms_api.py:334: in create_project
r = client.session.post(f"{url}", data=json_data)
.tox/py312-coverage/lib/python3.12/site-packages/requests/sessions.py:637: in post
return self.request("POST", url, data=data, json=json, **kwargs)
.tox/py312-coverage/lib/python3.12/site-packages/requests/sessions.py:589: in request
resp = self.send(prep, **send_kwargs)
.tox/py312-coverage/lib/python3.12/site-packages/requests/sessions.py:710: in send
r = dispatch_hook("response", hooks, r, **kwargs)
.tox/py312-coverage/lib/python3.12/site-packages/requests/hooks.py:30: in dispatch_hook
_hook_data = hook(hook_data, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
response = <Response [503]>, args = ()
kwargs = {'cert': None, 'proxies': OrderedDict(), 'stream': False, 'timeout': None, ...}
r_content = {}, reason = 'Service Unavailable', description = None
error_msg = '503 Server Error: Service Unavailable for: POST https://localhost:8443/hps/jms/api/v1/projects/?fields=all'
def raise_for_status(response, *args, **kwargs):
"""Automatically checks HTTP errors.
This method mimics the requests.Response.raise_for_status() method.
"""
if 400 <= response.status_code < 600:
r_content = {}
try:
r_content = response.json()
except ValueError:
pass
reason = r_content.get("title", None) # jms api
if not reason:
reason = r_content.get("error", None) # auth api
if not reason:
reason = response.reason
description = r_content.get("description", None) # jms api
if not description:
description = r_content.get("error_description", None) # auth api
if 400 <= response.status_code < 500:
error_msg = "%s Client Error: %s for: %s %s" % (
response.status_code,
reason,
response.request.method,
response.url,
)
if description:
error_msg += f"\n{description}"
raise ClientError(error_msg, reason=reason, description=description, response=response)
elif 500 <= response.status_code < 600:
error_msg = "%s Server Error: %s for: %s %s" % (
response.status_code,
reason,
response.request.method,
response.url,
)
if description:
error_msg += f"\n{description}"
> raise APIError(error_msg, reason=reason, description=description, response=response)
E ansys.hps.client.exceptions.APIError: 503 Server Error: Service Unavailable for: POST https://localhost:8443/hps/jms/api/v1/projects/?fields=all
.tox/py312-coverage/lib/python3.12/site-packages/ansys/hps/client/exceptions.py:108: APIError
Check failure on line 71 in tests/jms/test_project_permissions.py
github-actions / Test Report ubuntu-latest:3.12
test_project_permissions.test_get_project_permissions
ansys.hps.client.exceptions.APIError: 503 Server Error: Service Unavailable for: POST https://localhost:8443/hps/jms/api/v1/projects/?fields=all
Raw output
client = <ansys.hps.client.client.Client object at 0x7f515e43da60>
def test_get_project_permissions(client):
jms_api = JmsApi(client)
proj_name = f"test_jms_get_permissions_test"
proj = Project(name=proj_name, active=True, priority=10)
> proj = jms_api.create_project(proj, replace=True)
tests/jms/test_project_permissions.py:71:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/py312-coverage/lib/python3.12/site-packages/ansys/hps/client/jms/api/jms_api.py:120: in create_project
return create_project(self.client, self.url, project, replace, as_objects)
.tox/py312-coverage/lib/python3.12/site-packages/ansys/hps/client/jms/api/jms_api.py:334: in create_project
r = client.session.post(f"{url}", data=json_data)
.tox/py312-coverage/lib/python3.12/site-packages/requests/sessions.py:637: in post
return self.request("POST", url, data=data, json=json, **kwargs)
.tox/py312-coverage/lib/python3.12/site-packages/requests/sessions.py:589: in request
resp = self.send(prep, **send_kwargs)
.tox/py312-coverage/lib/python3.12/site-packages/requests/sessions.py:710: in send
r = dispatch_hook("response", hooks, r, **kwargs)
.tox/py312-coverage/lib/python3.12/site-packages/requests/hooks.py:30: in dispatch_hook
_hook_data = hook(hook_data, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
response = <Response [503]>, args = ()
kwargs = {'cert': None, 'proxies': OrderedDict(), 'stream': False, 'timeout': None, ...}
r_content = {}, reason = 'Service Unavailable', description = None
error_msg = '503 Server Error: Service Unavailable for: POST https://localhost:8443/hps/jms/api/v1/projects/?fields=all'
def raise_for_status(response, *args, **kwargs):
"""Automatically checks HTTP errors.
This method mimics the requests.Response.raise_for_status() method.
"""
if 400 <= response.status_code < 600:
r_content = {}
try:
r_content = response.json()
except ValueError:
pass
reason = r_content.get("title", None) # jms api
if not reason:
reason = r_content.get("error", None) # auth api
if not reason:
reason = response.reason
description = r_content.get("description", None) # jms api
if not description:
description = r_content.get("error_description", None) # auth api
if 400 <= response.status_code < 500:
error_msg = "%s Client Error: %s for: %s %s" % (
response.status_code,
reason,
response.request.method,
response.url,
)
if description:
error_msg += f"\n{description}"
raise ClientError(error_msg, reason=reason, description=description, response=response)
elif 500 <= response.status_code < 600:
error_msg = "%s Server Error: %s for: %s %s" % (
response.status_code,
reason,
response.request.method,
response.url,
)
if description:
error_msg += f"\n{description}"
> raise APIError(error_msg, reason=reason, description=description, response=response)
E ansys.hps.client.exceptions.APIError: 503 Server Error: Service Unavailable for: POST https://localhost:8443/hps/jms/api/v1/projects/?fields=all
.tox/py312-coverage/lib/python3.12/site-packages/ansys/hps/client/exceptions.py:108: APIError
Check failure on line 134 in tests/jms/test_project_permissions.py
github-actions / Test Report ubuntu-latest:3.12
test_project_permissions.test_modify_project_permissions
ansys.hps.client.exceptions.APIError: 503 Server Error: Service Unavailable for: POST https://localhost:8443/hps/jms/api/v1/projects/?fields=all
Raw output
client = <ansys.hps.client.client.Client object at 0x7f515e43da60>
keycloak_client = <keycloak.keycloak_admin.KeycloakAdmin object at 0x7f515e08c260>
def test_modify_project_permissions(client, keycloak_client):
user_credentials = {
"user1": {"username": f"testuser-{uuid.uuid4().hex[:8]}", "password": "test"},
"user2": {"username": f"testuser-{uuid.uuid4().hex[:8]}", "password": "test"},
}
proj_name = f"test_jms_get_permissions_test_{uuid.uuid4().hex[:8]}"
auth_api = AuthApi(client)
existing_users = [u.username for u in auth_api.get_users()]
if user_credentials["user1"]["username"] not in existing_users:
user1 = create_user(
keycloak_client,
User(
username=user_credentials["user1"]["username"],
password=user_credentials["user1"]["password"],
),
)
else:
user1 = [
u for u in auth_api.get_users() if u.username == user_credentials["user1"]["username"]
][0]
log.info(f"User 1: {user1}")
if user_credentials["user2"]["username"] not in existing_users:
user2 = create_user(
keycloak_client,
User(
username=user_credentials["user2"]["username"],
password=user_credentials["user2"]["password"],
),
)
else:
user2 = [
u for u in auth_api.get_users() if u.username == user_credentials["user2"]["username"]
][0]
log.info(f"User 2: {user2}")
# user1 creates a project and a job definition
client1 = Client(
url=client.url,
username=user1.username,
password=user_credentials["user1"]["password"],
)
log.info(f"Client connected at {client1.url} with user {user1.username}")
root_api1 = JmsApi(client1)
proj = Project(name=proj_name, priority=1, active=True)
> proj = root_api1.create_project(proj, replace=True)
tests/jms/test_project_permissions.py:134:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/py312-coverage/lib/python3.12/site-packages/ansys/hps/client/jms/api/jms_api.py:120: in create_project
return create_project(self.client, self.url, project, replace, as_objects)
.tox/py312-coverage/lib/python3.12/site-packages/ansys/hps/client/jms/api/jms_api.py:334: in create_project
r = client.session.post(f"{url}", data=json_data)
.tox/py312-coverage/lib/python3.12/site-packages/requests/sessions.py:637: in post
return self.request("POST", url, data=data, json=json, **kwargs)
.tox/py312-coverage/lib/python3.12/site-packages/requests/sessions.py:589: in request
resp = self.send(prep, **send_kwargs)
.tox/py312-coverage/lib/python3.12/site-packages/requests/sessions.py:710: in send
r = dispatch_hook("response", hooks, r, **kwargs)
.tox/py312-coverage/lib/python3.12/site-packages/requests/hooks.py:30: in dispatch_hook
_hook_data = hook(hook_data, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
response = <Response [503]>, args = ()
kwargs = {'cert': None, 'proxies': OrderedDict(), 'stream': False, 'timeout': None, ...}
r_content = {}, reason = 'Service Unavailable', description = None
error_msg = '503 Server Error: Service Unavailable for: POST https://localhost:8443/hps/jms/api/v1/projects/?fields=all'
def raise_for_status(response, *args, **kwargs):
"""Automatically checks HTTP errors.
This method mimics the requests.Response.raise_for_status() method.
"""
if 400 <= response.status_code < 600:
r_content = {}
try:
r_content = response.json()
except ValueError:
pass
reason = r_content.get("title", None) # jms api
if not reason:
reason = r_content.get("error", None) # auth api
if not reason:
reason = response.reason
description = r_content.get("description", None) # jms api
if not description:
description = r_content.get("error_description", None) # auth api
if 400 <= response.status_code < 500:
error_msg = "%s Client Error: %s for: %s %s" % (
response.status_code,
reason,
response.request.method,
response.url,
)
if description:
error_msg += f"\n{description}"
raise ClientError(error_msg, reason=reason, description=description, response=response)
elif 500 <= response.status_code < 600:
error_msg = "%s Server Error: %s for: %s %s" % (
response.status_code,
reason,
response.request.method,
response.url,
)
if description:
error_msg += f"\n{description}"
> raise APIError(error_msg, reason=reason, description=description, response=response)
E ansys.hps.client.exceptions.APIError: 503 Server Error: Service Unavailable for: POST https://localhost:8443/hps/jms/api/v1/projects/?fields=all
.tox/py312-coverage/lib/python3.12/site-packages/ansys/hps/client/exceptions.py:108: APIError
Check failure on line 97 in tests/jms/test_projects.py
github-actions / Test Report ubuntu-latest:3.12
test_projects.test_project_integration
ansys.hps.client.exceptions.APIError: 503 Server Error: Service Unavailable for: POST https://localhost:8443/hps/jms/api/v1/projects/?fields=all
Raw output
client = <ansys.hps.client.client.Client object at 0x7f515e43da60>
def test_project_integration(client):
jms_api = JmsApi(client)
proj_name = f"test_jms_ProjectTest"
proj = Project(name=proj_name, active=True, priority=10)
> proj = jms_api.create_project(proj, replace=True)
tests/jms/test_projects.py:97:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/py312-coverage/lib/python3.12/site-packages/ansys/hps/client/jms/api/jms_api.py:120: in create_project
return create_project(self.client, self.url, project, replace, as_objects)
.tox/py312-coverage/lib/python3.12/site-packages/ansys/hps/client/jms/api/jms_api.py:334: in create_project
r = client.session.post(f"{url}", data=json_data)
.tox/py312-coverage/lib/python3.12/site-packages/requests/sessions.py:637: in post
return self.request("POST", url, data=data, json=json, **kwargs)
.tox/py312-coverage/lib/python3.12/site-packages/requests/sessions.py:589: in request
resp = self.send(prep, **send_kwargs)
.tox/py312-coverage/lib/python3.12/site-packages/requests/sessions.py:710: in send
r = dispatch_hook("response", hooks, r, **kwargs)
.tox/py312-coverage/lib/python3.12/site-packages/requests/hooks.py:30: in dispatch_hook
_hook_data = hook(hook_data, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
response = <Response [503]>, args = ()
kwargs = {'cert': None, 'proxies': OrderedDict(), 'stream': False, 'timeout': None, ...}
r_content = {}, reason = 'Service Unavailable', description = None
error_msg = '503 Server Error: Service Unavailable for: POST https://localhost:8443/hps/jms/api/v1/projects/?fields=all'
def raise_for_status(response, *args, **kwargs):
"""Automatically checks HTTP errors.
This method mimics the requests.Response.raise_for_status() method.
"""
if 400 <= response.status_code < 600:
r_content = {}
try:
r_content = response.json()
except ValueError:
pass
reason = r_content.get("title", None) # jms api
if not reason:
reason = r_content.get("error", None) # auth api
if not reason:
reason = response.reason
description = r_content.get("description", None) # jms api
if not description:
description = r_content.get("error_description", None) # auth api
if 400 <= response.status_code < 500:
error_msg = "%s Client Error: %s for: %s %s" % (
response.status_code,
reason,
response.request.method,
response.url,
)
if description:
error_msg += f"\n{description}"
raise ClientError(error_msg, reason=reason, description=description, response=response)
elif 500 <= response.status_code < 600:
error_msg = "%s Server Error: %s for: %s %s" % (
response.status_code,
reason,
response.request.method,
response.url,
)
if description:
error_msg += f"\n{description}"
> raise APIError(error_msg, reason=reason, description=description, response=response)
E ansys.hps.client.exceptions.APIError: 503 Server Error: Service Unavailable for: POST https://localhost:8443/hps/jms/api/v1/projects/?fields=all
.tox/py312-coverage/lib/python3.12/site-packages/ansys/hps/client/exceptions.py:108: APIError
Check failure on line 145 in tests/jms/test_projects.py
github-actions / Test Report ubuntu-latest:3.12
test_projects.test_project_copy
ansys.hps.client.exceptions.APIError: 503 Server Error: Service Unavailable for: POST https://localhost:8443/hps/jms/api/v1/projects/?fields=all
Raw output
client = <ansys.hps.client.client.Client object at 0x7f515e43da60>
def test_project_copy(client):
jms_api = JmsApi(client)
proj_name = f"test_jms_ProjectCopyTest"
proj = Project(name=proj_name, active=True, priority=10)
> proj = jms_api.create_project(proj, replace=True)
tests/jms/test_projects.py:145:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/py312-coverage/lib/python3.12/site-packages/ansys/hps/client/jms/api/jms_api.py:120: in create_project
return create_project(self.client, self.url, project, replace, as_objects)
.tox/py312-coverage/lib/python3.12/site-packages/ansys/hps/client/jms/api/jms_api.py:334: in create_project
r = client.session.post(f"{url}", data=json_data)
.tox/py312-coverage/lib/python3.12/site-packages/requests/sessions.py:637: in post
return self.request("POST", url, data=data, json=json, **kwargs)
.tox/py312-coverage/lib/python3.12/site-packages/requests/sessions.py:589: in request
resp = self.send(prep, **send_kwargs)
.tox/py312-coverage/lib/python3.12/site-packages/requests/sessions.py:710: in send
r = dispatch_hook("response", hooks, r, **kwargs)
.tox/py312-coverage/lib/python3.12/site-packages/requests/hooks.py:30: in dispatch_hook
_hook_data = hook(hook_data, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
response = <Response [503]>, args = ()
kwargs = {'cert': None, 'proxies': OrderedDict(), 'stream': False, 'timeout': None, ...}
r_content = {}, reason = 'Service Unavailable', description = None
error_msg = '503 Server Error: Service Unavailable for: POST https://localhost:8443/hps/jms/api/v1/projects/?fields=all'
def raise_for_status(response, *args, **kwargs):
"""Automatically checks HTTP errors.
This method mimics the requests.Response.raise_for_status() method.
"""
if 400 <= response.status_code < 600:
r_content = {}
try:
r_content = response.json()
except ValueError:
pass
reason = r_content.get("title", None) # jms api
if not reason:
reason = r_content.get("error", None) # auth api
if not reason:
reason = response.reason
description = r_content.get("description", None) # jms api
if not description:
description = r_content.get("error_description", None) # auth api
if 400 <= response.status_code < 500:
error_msg = "%s Client Error: %s for: %s %s" % (
response.status_code,
reason,
response.request.method,
response.url,
)
if description:
error_msg += f"\n{description}"
raise ClientError(error_msg, reason=reason, description=description, response=response)
elif 500 <= response.status_code < 600:
error_msg = "%s Server Error: %s for: %s %s" % (
response.status_code,
reason,
response.request.method,
response.url,
)
if description:
error_msg += f"\n{description}"
> raise APIError(error_msg, reason=reason, description=description, response=response)
E ansys.hps.client.exceptions.APIError: 503 Server Error: Service Unavailable for: POST https://localhost:8443/hps/jms/api/v1/projects/?fields=all
.tox/py312-coverage/lib/python3.12/site-packages/ansys/hps/client/exceptions.py:108: APIError
Check failure on line 226 in tests/jms/test_projects.py
github-actions / Test Report ubuntu-latest:3.12
test_projects.test_project_delete_job_definition
ansys.hps.client.exceptions.APIError: 503 Server Error: Service Unavailable for: POST https://localhost:8443/hps/jms/api/v1/projects/?fields=all
Raw output
client = <ansys.hps.client.client.Client object at 0x7f515e43da60>
def test_project_delete_job_definition(client):
jms_api = JmsApi(client)
proj_name = f"test_jms_ProjectTest_delete_config"
proj = Project(name=proj_name, active=True, priority=10)
> proj = jms_api.create_project(proj, replace=True)
tests/jms/test_projects.py:226:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/py312-coverage/lib/python3.12/site-packages/ansys/hps/client/jms/api/jms_api.py:120: in create_project
return create_project(self.client, self.url, project, replace, as_objects)
.tox/py312-coverage/lib/python3.12/site-packages/ansys/hps/client/jms/api/jms_api.py:334: in create_project
r = client.session.post(f"{url}", data=json_data)
.tox/py312-coverage/lib/python3.12/site-packages/requests/sessions.py:637: in post
return self.request("POST", url, data=data, json=json, **kwargs)
.tox/py312-coverage/lib/python3.12/site-packages/requests/sessions.py:589: in request
resp = self.send(prep, **send_kwargs)
.tox/py312-coverage/lib/python3.12/site-packages/requests/sessions.py:710: in send
r = dispatch_hook("response", hooks, r, **kwargs)
.tox/py312-coverage/lib/python3.12/site-packages/requests/hooks.py:30: in dispatch_hook
_hook_data = hook(hook_data, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
response = <Response [503]>, args = ()
kwargs = {'cert': None, 'proxies': OrderedDict(), 'stream': False, 'timeout': None, ...}
r_content = {}, reason = 'Service Unavailable', description = None
error_msg = '503 Server Error: Service Unavailable for: POST https://localhost:8443/hps/jms/api/v1/projects/?fields=all'
def raise_for_status(response, *args, **kwargs):
"""Automatically checks HTTP errors.
This method mimics the requests.Response.raise_for_status() method.
"""
if 400 <= response.status_code < 600:
r_content = {}
try:
r_content = response.json()
except ValueError:
pass
reason = r_content.get("title", None) # jms api
if not reason:
reason = r_content.get("error", None) # auth api
if not reason:
reason = response.reason
description = r_content.get("description", None) # jms api
if not description:
description = r_content.get("error_description", None) # auth api
if 400 <= response.status_code < 500:
error_msg = "%s Client Error: %s for: %s %s" % (
response.status_code,
reason,
response.request.method,
response.url,
)
if description:
error_msg += f"\n{description}"
raise ClientError(error_msg, reason=reason, description=description, response=response)
elif 500 <= response.status_code < 600:
error_msg = "%s Server Error: %s for: %s %s" % (
response.status_code,
reason,
response.request.method,
response.url,
)
if description:
error_msg += f"\n{description}"
> raise APIError(error_msg, reason=reason, description=description, response=response)
E ansys.hps.client.exceptions.APIError: 503 Server Error: Service Unavailable for: POST https://localhost:8443/hps/jms/api/v1/projects/?fields=all
.tox/py312-coverage/lib/python3.12/site-packages/ansys/hps/client/exceptions.py:108: APIError
Check failure on line 246 in tests/jms/test_projects.py
github-actions / Test Report ubuntu-latest:3.12
test_projects.test_project_archive_restore
ansys.hps.client.exceptions.APIError: 503 Server Error: Service Unavailable for: POST https://localhost:8443/hps/jms/api/v1/projects/?fields=all
Raw output
client = <ansys.hps.client.client.Client object at 0x7f515e43da60>
def test_project_archive_restore(client):
num_jobs = 2
jms_api = JmsApi(client)
proj_name = f"test_jms_project_archive_restore"
# Setup project to work with
> project = motorbike_create_project(client=client, name=proj_name, num_jobs=num_jobs)
tests/jms/test_projects.py:246:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
examples/mapdl_motorbike_frame/project_setup.py:73: in create_project
proj = jms_api.create_project(proj, replace=True)
.tox/py312-coverage/lib/python3.12/site-packages/ansys/hps/client/jms/api/jms_api.py:120: in create_project
return create_project(self.client, self.url, project, replace, as_objects)
.tox/py312-coverage/lib/python3.12/site-packages/ansys/hps/client/jms/api/jms_api.py:334: in create_project
r = client.session.post(f"{url}", data=json_data)
.tox/py312-coverage/lib/python3.12/site-packages/requests/sessions.py:637: in post
return self.request("POST", url, data=data, json=json, **kwargs)
.tox/py312-coverage/lib/python3.12/site-packages/requests/sessions.py:589: in request
resp = self.send(prep, **send_kwargs)
.tox/py312-coverage/lib/python3.12/site-packages/requests/sessions.py:710: in send
r = dispatch_hook("response", hooks, r, **kwargs)
.tox/py312-coverage/lib/python3.12/site-packages/requests/hooks.py:30: in dispatch_hook
_hook_data = hook(hook_data, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
response = <Response [503]>, args = ()
kwargs = {'cert': None, 'proxies': OrderedDict(), 'stream': False, 'timeout': None, ...}
r_content = {}, reason = 'Service Unavailable', description = None
error_msg = '503 Server Error: Service Unavailable for: POST https://localhost:8443/hps/jms/api/v1/projects/?fields=all'
def raise_for_status(response, *args, **kwargs):
"""Automatically checks HTTP errors.
This method mimics the requests.Response.raise_for_status() method.
"""
if 400 <= response.status_code < 600:
r_content = {}
try:
r_content = response.json()
except ValueError:
pass
reason = r_content.get("title", None) # jms api
if not reason:
reason = r_content.get("error", None) # auth api
if not reason:
reason = response.reason
description = r_content.get("description", None) # jms api
if not description:
description = r_content.get("error_description", None) # auth api
if 400 <= response.status_code < 500:
error_msg = "%s Client Error: %s for: %s %s" % (
response.status_code,
reason,
response.request.method,
response.url,
)
if description:
error_msg += f"\n{description}"
raise ClientError(error_msg, reason=reason, description=description, response=response)
elif 500 <= response.status_code < 600:
error_msg = "%s Server Error: %s for: %s %s" % (
response.status_code,
reason,
response.request.method,
response.url,
)
if description:
error_msg += f"\n{description}"
> raise APIError(error_msg, reason=reason, description=description, response=response)
E ansys.hps.client.exceptions.APIError: 503 Server Error: Service Unavailable for: POST https://localhost:8443/hps/jms/api/v1/projects/?fields=all
.tox/py312-coverage/lib/python3.12/site-packages/ansys/hps/client/exceptions.py:108: APIError
Check failure on line 282 in tests/jms/test_projects.py
github-actions / Test Report ubuntu-latest:3.12
test_projects.test_copy_exec_script
ansys.hps.client.exceptions.APIError: 503 Server Error: Service Unavailable for: POST https://localhost:8443/hps/jms/api/v1/projects/?fields=all
Raw output
client = <ansys.hps.client.client.Client object at 0x7f515e43da60>
def test_copy_exec_script(client):
jms_api = JmsApi(client)
proj_name = f"test_copy_exec_script"
proj = Project(name=proj_name)
> proj = jms_api.create_project(proj)
tests/jms/test_projects.py:282:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/py312-coverage/lib/python3.12/site-packages/ansys/hps/client/jms/api/jms_api.py:120: in create_project
return create_project(self.client, self.url, project, replace, as_objects)
.tox/py312-coverage/lib/python3.12/site-packages/ansys/hps/client/jms/api/jms_api.py:334: in create_project
r = client.session.post(f"{url}", data=json_data)
.tox/py312-coverage/lib/python3.12/site-packages/requests/sessions.py:637: in post
return self.request("POST", url, data=data, json=json, **kwargs)
.tox/py312-coverage/lib/python3.12/site-packages/requests/sessions.py:589: in request
resp = self.send(prep, **send_kwargs)
.tox/py312-coverage/lib/python3.12/site-packages/requests/sessions.py:710: in send
r = dispatch_hook("response", hooks, r, **kwargs)
.tox/py312-coverage/lib/python3.12/site-packages/requests/hooks.py:30: in dispatch_hook
_hook_data = hook(hook_data, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
response = <Response [503]>, args = ()
kwargs = {'cert': None, 'proxies': OrderedDict(), 'stream': False, 'timeout': None, ...}
r_content = {}, reason = 'Service Unavailable', description = None
error_msg = '503 Server Error: Service Unavailable for: POST https://localhost:8443/hps/jms/api/v1/projects/?fields=all'
def raise_for_status(response, *args, **kwargs):
"""Automatically checks HTTP errors.
This method mimics the requests.Response.raise_for_status() method.
"""
if 400 <= response.status_code < 600:
r_content = {}
try:
r_content = response.json()
except ValueError:
pass
reason = r_content.get("title", None) # jms api
if not reason:
reason = r_content.get("error", None) # auth api
if not reason:
reason = response.reason
description = r_content.get("description", None) # jms api
if not description:
description = r_content.get("error_description", None) # auth api
if 400 <= response.status_code < 500:
error_msg = "%s Client Error: %s for: %s %s" % (
response.status_code,
reason,
response.request.method,
response.url,
)
if description:
error_msg += f"\n{description}"
raise ClientError(error_msg, reason=reason, description=description, response=response)
elif 500 <= response.status_code < 600:
error_msg = "%s Server Error: %s for: %s %s" % (
response.status_code,
reason,
response.request.method,
response.url,
)
if description:
error_msg += f"\n{description}"
> raise APIError(error_msg, reason=reason, description=description, response=response)
E ansys.hps.client.exceptions.APIError: 503 Server Error: Service Unavailable for: POST https://localhost:8443/hps/jms/api/v1/projects/?fields=all
.tox/py312-coverage/lib/python3.12/site-packages/ansys/hps/client/exceptions.py:108: APIError
Check failure on line 139 in tests/jms/test_resources.py
github-actions / Test Report ubuntu-latest:3.12
test_resources.test_jobs_equality
ansys.hps.client.exceptions.APIError: 503 Server Error: Service Unavailable for: POST https://localhost:8443/hps/jms/api/v1/projects/?fields=all
Raw output
client = <ansys.hps.client.client.Client object at 0x7f515e43da60>
def test_jobs_equality(client):
# create new project
num_jobs = 1
> project = create_project(
client,
f"test_jobs_equality",
num_jobs=num_jobs,
use_exec_script=False,
active=False,
)
tests/jms/test_resources.py:139:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
examples/mapdl_motorbike_frame/project_setup.py:73: in create_project
proj = jms_api.create_project(proj, replace=True)
.tox/py312-coverage/lib/python3.12/site-packages/ansys/hps/client/jms/api/jms_api.py:120: in create_project
return create_project(self.client, self.url, project, replace, as_objects)
.tox/py312-coverage/lib/python3.12/site-packages/ansys/hps/client/jms/api/jms_api.py:334: in create_project
r = client.session.post(f"{url}", data=json_data)
.tox/py312-coverage/lib/python3.12/site-packages/requests/sessions.py:637: in post
return self.request("POST", url, data=data, json=json, **kwargs)
.tox/py312-coverage/lib/python3.12/site-packages/requests/sessions.py:589: in request
resp = self.send(prep, **send_kwargs)
.tox/py312-coverage/lib/python3.12/site-packages/requests/sessions.py:710: in send
r = dispatch_hook("response", hooks, r, **kwargs)
.tox/py312-coverage/lib/python3.12/site-packages/requests/hooks.py:30: in dispatch_hook
_hook_data = hook(hook_data, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
response = <Response [503]>, args = ()
kwargs = {'cert': None, 'proxies': OrderedDict(), 'stream': False, 'timeout': None, ...}
r_content = {}, reason = 'Service Unavailable', description = None
error_msg = '503 Server Error: Service Unavailable for: POST https://localhost:8443/hps/jms/api/v1/projects/?fields=all'
def raise_for_status(response, *args, **kwargs):
"""Automatically checks HTTP errors.
This method mimics the requests.Response.raise_for_status() method.
"""
if 400 <= response.status_code < 600:
r_content = {}
try:
r_content = response.json()
except ValueError:
pass
reason = r_content.get("title", None) # jms api
if not reason:
reason = r_content.get("error", None) # auth api
if not reason:
reason = response.reason
description = r_content.get("description", None) # jms api
if not description:
description = r_content.get("error_description", None) # auth api
if 400 <= response.status_code < 500:
error_msg = "%s Client Error: %s for: %s %s" % (
response.status_code,
reason,
response.request.method,
response.url,
)
if description:
error_msg += f"\n{description}"
raise ClientError(error_msg, reason=reason, description=description, response=response)
elif 500 <= response.status_code < 600:
error_msg = "%s Server Error: %s for: %s %s" % (
response.status_code,
reason,
response.request.method,
response.url,
)
if description:
error_msg += f"\n{description}"
> raise APIError(error_msg, reason=reason, description=description, response=response)
E ansys.hps.client.exceptions.APIError: 503 Server Error: Service Unavailable for: POST https://localhost:8443/hps/jms/api/v1/projects/?fields=all
.tox/py312-coverage/lib/python3.12/site-packages/ansys/hps/client/exceptions.py:108: APIError