Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✅ e2e: Final touches to tip testing #6459

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions packages/pytest-simcore/src/pytest_simcore/helpers/playwright.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,6 @@ def __call__(self, message: str) -> None:
class SocketIONodeProgressCompleteWaiter:
node_id: str
logger: logging.Logger
_last_call_return: bool = False
_current_progress: dict[NodeProgressType, float] = field(
default_factory=defaultdict
)
Expand Down Expand Up @@ -224,24 +223,24 @@ def __call__(self, message: str) -> bool:
self._current_progress[
node_progress_event.progress_type
] = new_progress

self.logger.info(
"current startup progress: %s",
"Current startup progress [expected number of node-progress-types=%d]: %s",
NodeProgressType.required_types_for_started_service(),
f"{json.dumps({k:round(v,1) for k,v in self._current_progress.items()})}",
)

self._last_call_return = all(
progress_type in self._current_progress
for progress_type in NodeProgressType.required_types_for_started_service()
) and all(
return self.got_expected_node_progress_types() and all(
round(progress, 1) == 1.0
for progress in self._current_progress.values()
)
return self._last_call_return
self._last_call_return = False
return False

def get_last_call_return(self):
return self._last_call_return
def got_expected_node_progress_types(self):
return all(
progress_type in self._current_progress
for progress_type in NodeProgressType.required_types_for_started_service()
)

def get_current_progress(self):
return self._current_progress.values()
Expand Down Expand Up @@ -339,16 +338,17 @@ def expected_service_running(
service_running = ServiceRunning(iframe_locator=None)

try:

with websocket.expect_event("framereceived", waiter, timeout=timeout):
if press_start_button:
_trigger_service_start(page, node_id)

yield service_running

except PlaywrightTimeoutError:
if waiter.get_last_call_return() is False:
if waiter.got_expected_node_progress_types():
pcrespov marked this conversation as resolved.
Show resolved Hide resolved
ctx.logger.warning(
"⚠️ Progress bar didn't receive 100 percent: %s ⚠️", # https://github.com/ITISFoundation/osparc-simcore/issues/6449
"⚠️ 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
waiter.get_current_progress(),
)
else:
Expand Down
Loading