Skip to content

Commit 2e432ba

Browse files
committed
show message as error if needed
1 parent 6b77318 commit 2e432ba

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

packages/pytest-simcore/src/pytest_simcore/helpers/playwright.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,17 +335,22 @@ def __call__(self, message: str) -> bool:
335335
)
336336

337337
_current_timestamp = datetime.now(UTC)
338-
if _current_timestamp - self._last_poll_timestamp > timedelta(seconds=10):
338+
if _current_timestamp - self._last_poll_timestamp > timedelta(seconds=5):
339339
url = f"https://{self.node_id}.services.{self.get_partial_product_url()}"
340340
response = self.api_request_context.get(url, timeout=1000)
341-
self.logger.info(
341+
level = logging.DEBUG
342+
if (response.status >= 400) and (response.status not in (502, 503)):
343+
level = logging.ERROR
344+
self.logger.log(
345+
level,
342346
"Querying service endpoint in case we missed some websocket messages. Url: %s Response: '%s' TIP: %s",
343347
url,
344348
f"{response.status}: {response.text()}",
345349
(
346350
"We are emulating the frontend; a 5XX response is acceptable if the service is not yet ready."
347351
),
348352
)
353+
349354
if response.status <= 400:
350355
# 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)
351356
if self.got_expected_node_progress_types():

0 commit comments

Comments
 (0)