Skip to content

Commit 9609abd

Browse files
authored
✅ e2e: Final touches to tip testing (#6459)
1 parent a50d80c commit 9609abd

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

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

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,6 @@ def __call__(self, message: str) -> None:
196196
class SocketIONodeProgressCompleteWaiter:
197197
node_id: str
198198
logger: logging.Logger
199-
_last_call_return: bool = False
200199
_current_progress: dict[NodeProgressType, float] = field(
201200
default_factory=defaultdict
202201
)
@@ -224,24 +223,24 @@ def __call__(self, message: str) -> bool:
224223
self._current_progress[
225224
node_progress_event.progress_type
226225
] = new_progress
226+
227227
self.logger.info(
228-
"current startup progress: %s",
228+
"Current startup progress [expected number of node-progress-types=%d]: %s",
229+
NodeProgressType.required_types_for_started_service(),
229230
f"{json.dumps({k:round(v,1) for k,v in self._current_progress.items()})}",
230231
)
231232

232-
self._last_call_return = all(
233-
progress_type in self._current_progress
234-
for progress_type in NodeProgressType.required_types_for_started_service()
235-
) and all(
233+
return self.got_expected_node_progress_types() and all(
236234
round(progress, 1) == 1.0
237235
for progress in self._current_progress.values()
238236
)
239-
return self._last_call_return
240-
self._last_call_return = False
241237
return False
242238

243-
def get_last_call_return(self):
244-
return self._last_call_return
239+
def got_expected_node_progress_types(self):
240+
return all(
241+
progress_type in self._current_progress
242+
for progress_type in NodeProgressType.required_types_for_started_service()
243+
)
245244

246245
def get_current_progress(self):
247246
return self._current_progress.values()
@@ -339,16 +338,17 @@ def expected_service_running(
339338
service_running = ServiceRunning(iframe_locator=None)
340339

341340
try:
341+
342342
with websocket.expect_event("framereceived", waiter, timeout=timeout):
343343
if press_start_button:
344344
_trigger_service_start(page, node_id)
345345

346346
yield service_running
347347

348348
except PlaywrightTimeoutError:
349-
if waiter.get_last_call_return() is False:
349+
if waiter.got_expected_node_progress_types():
350350
ctx.logger.warning(
351-
"⚠️ Progress bar didn't receive 100 percent: %s ⚠️", # https://github.com/ITISFoundation/osparc-simcore/issues/6449
351+
"⚠️ Progress bar didn't receive 100 percent but all expected node-progress-types are in place: %s ⚠️", # https://github.com/ITISFoundation/osparc-simcore/issues/6449
352352
waiter.get_current_progress(),
353353
)
354354
else:

0 commit comments

Comments
 (0)