Skip to content

Commit ab69603

Browse files
authored
🎨 E2E: upgrade timings (#7511)
1 parent 01c090f commit ab69603

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
from pathlib import Path
1717
from typing import Any, Final
1818

19+
import arrow
1920
import pytest
2021
from playwright._impl._sync_base import EventContextManager
2122
from playwright.sync_api import (
@@ -385,7 +386,7 @@ def _check_service_endpoint(
385386

386387

387388
_SOCKET_IO_NODE_PROGRESS_WAITER_MAX_IDLE_TIMEOUT: Final[timedelta] = timedelta(
388-
seconds=30
389+
seconds=60
389390
)
390391

391392

@@ -580,6 +581,7 @@ def expected_service_running(
580581
is_service_legacy: bool,
581582
assertion_output_folder: Path,
582583
) -> Generator[ServiceRunning, None, None]:
584+
started = arrow.utcnow()
583585
with log_context(
584586
logging.INFO, msg=f"Waiting for node to run. Timeout: {timeout}"
585587
) as ctx:
@@ -588,17 +590,19 @@ def expected_service_running(
588590
logger=ctx.logger,
589591
)
590592
service_running = ServiceRunning(iframe_locator=None)
591-
592593
with websocket.expect_event("framereceived", waiter, timeout=timeout):
593594
if press_start_button:
594595
_trigger_service_start(page, node_id)
595596

596597
yield service_running
598+
elapsed_time = arrow.utcnow() - started
599+
597600
wait_for_service_endpoint_responding(
598601
node_id,
599602
api_request_context=page.request,
600603
product_url=product_url,
601604
is_legacy_service=is_service_legacy,
605+
timeout=min(timeout - int(elapsed_time.total_seconds() * SECOND), 5 * SECOND),
602606
)
603607
service_running.iframe_locator = page.frame_locator(
604608
f'[osparc-test-id="iframe_{node_id}"]'
@@ -619,6 +623,7 @@ def wait_for_service_running(
619623
"""NOTE: if the service was already started this will not work as some of the required websocket events will not be emitted again
620624
In which case this will need further adjutment"""
621625

626+
started = arrow.utcnow()
622627
with log_context(
623628
logging.INFO, msg=f"Waiting for node to run. Timeout: {timeout}"
624629
) as ctx:
@@ -629,12 +634,13 @@ def wait_for_service_running(
629634
with websocket.expect_event("framereceived", waiter, timeout=timeout):
630635
if press_start_button:
631636
_trigger_service_start(page, node_id)
632-
637+
elapsed_time = arrow.utcnow() - started
633638
wait_for_service_endpoint_responding(
634639
node_id,
635640
api_request_context=page.request,
636641
product_url=product_url,
637642
is_legacy_service=is_service_legacy,
643+
timeout=min(timeout - int(elapsed_time.total_seconds() * SECOND), 5 * SECOND),
638644
)
639645
return page.frame_locator(f'[osparc-test-id="iframe_{node_id}"]')
640646

0 commit comments

Comments
 (0)