Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
sanderegg committed Jan 16, 2025
1 parent b6ccf23 commit b4c0f2d
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def _attempt_reconnect(self, logger: logging.Logger) -> None:
self.ws.expect_event(event, predicate)

except Exception as e: # pylint: disable=broad-except
logger.error("🚨 Failed to reconnect WebSocket: %s", e)
logger.exception("🚨 Failed to reconnect WebSocket: %s", e)

def expect_event(
self,
Expand Down Expand Up @@ -334,23 +334,20 @@ def __call__(self, message: str) -> bool:
for progress in self._current_progress.values()
)

# TODO: That is NOT what the frontend is doing... AND 401 is not OK it just means traefik responded that we are not authorized...
# therefore it stops WAY too early and will generate false negatives!!
_current_timestamp = datetime.now(UTC)
if _current_timestamp - self._last_poll_timestamp > timedelta(seconds=5):
url = f"https://{self.node_id}.services.{self.get_partial_product_url()}"
response = self.api_request_context.get(url, timeout=1000)
self.logger.info(
"Querying the service endpoint from the E2E test. Url: %s Response: %s TIP: %s",
url,
response,
f"{response.status}: {response.text}",
(
"We are emulating the frontend; a 500 response is acceptable if the service is not yet ready."
),
)
if response.status <= 400:
# NOTE: If the response status is less than 400, it means that the backend is ready (There are some services that respond with a 3XX)
# MD: for now I have included 401 - as this also means that backend is ready
if self.got_expected_node_progress_types():
self.logger.warning(
"⚠️ Progress bar didn't receive 100 percent but service is already running: %s ⚠️", # https://github.com/ITISFoundation/osparc-simcore/issues/6449
Expand Down

0 comments on commit b4c0f2d

Please sign in to comment.