Skip to content

Commit e2a6bdc

Browse files
matusdrobuliak66mrnicegyu11
authored andcommitted
🎨 improve tip e2e test (ITISFoundation#6448)
1 parent 6b7f9f8 commit e2a6bdc

File tree

1 file changed

+23
-4
lines changed

1 file changed

+23
-4
lines changed

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

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,14 @@ def __call__(self, message: str) -> bool:
236236

237237
return False
238238

239+
def is_progress_succesfully_finished(self) -> bool:
240+
return all(
241+
round(progress, 1) == 1.0 for progress in self._current_progress.values()
242+
)
243+
244+
def get_current_progress(self):
245+
return self._current_progress.values()
246+
239247

240248
def wait_for_pipeline_state(
241249
current_state: RunningState,
@@ -327,10 +335,21 @@ def expected_service_running(
327335
with log_context(logging.INFO, msg="Waiting for node to run") as ctx:
328336
waiter = SocketIONodeProgressCompleteWaiter(node_id=node_id, logger=ctx.logger)
329337
service_running = ServiceRunning(iframe_locator=None)
330-
with websocket.expect_event("framereceived", waiter, timeout=timeout):
331-
if press_start_button:
332-
_trigger_service_start(page, node_id)
333-
yield service_running
338+
339+
try:
340+
with websocket.expect_event("framereceived", waiter, timeout=timeout):
341+
if press_start_button:
342+
_trigger_service_start(page, node_id)
343+
except TimeoutError:
344+
if waiter.is_progress_succesfully_finished() is False:
345+
ctx.logger.warning(
346+
"⚠️ Progress bar didn't receive 100 percent: %s ⚠️", # https://github.com/ITISFoundation/osparc-simcore/issues/6449
347+
waiter.get_current_progress(),
348+
)
349+
else:
350+
raise
351+
352+
yield service_running
334353

335354
service_running.iframe_locator = page.frame_locator(
336355
f'[osparc-test-id="iframe_{node_id}"]'

0 commit comments

Comments
 (0)