diff --git a/packages/pytest-simcore/src/pytest_simcore/helpers/playwright.py b/packages/pytest-simcore/src/pytest_simcore/helpers/playwright.py index 0225642cc4f..38d016db73f 100644 --- a/packages/pytest-simcore/src/pytest_simcore/helpers/playwright.py +++ b/packages/pytest-simcore/src/pytest_simcore/helpers/playwright.py @@ -236,6 +236,14 @@ def __call__(self, message: str) -> bool: return False + def is_progress_succesfully_finished(self) -> bool: + return all( + round(progress, 1) == 1.0 for progress in self._current_progress.values() + ) + + def get_current_progress(self): + return self._current_progress.values() + def wait_for_pipeline_state( current_state: RunningState, @@ -327,10 +335,21 @@ def expected_service_running( with log_context(logging.INFO, msg="Waiting for node to run") as ctx: waiter = SocketIONodeProgressCompleteWaiter(node_id=node_id, logger=ctx.logger) service_running = ServiceRunning(iframe_locator=None) - with websocket.expect_event("framereceived", waiter, timeout=timeout): - if press_start_button: - _trigger_service_start(page, node_id) - yield service_running + + try: + with websocket.expect_event("framereceived", waiter, timeout=timeout): + if press_start_button: + _trigger_service_start(page, node_id) + except TimeoutError: + if waiter.is_progress_succesfully_finished() is False: + ctx.logger.warning( + "⚠️ Progress bar didn't receive 100 percent: %s ⚠️", # https://github.com/ITISFoundation/osparc-simcore/issues/6449 + waiter.get_current_progress(), + ) + else: + raise + + yield service_running service_running.iframe_locator = page.frame_locator( f'[osparc-test-id="iframe_{node_id}"]'