Skip to content

Commit 2be918d

Browse files
authored
🎨 [e2e]: Increase S4L's timeout when there is a workspace to download (#6338)
1 parent 891312a commit 2be918d

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

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

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
_EC2_STARTUP_MAX_WAIT_TIME + _S4L_DOCKER_PULLING_MAX_TIME + _S4L_MAX_STARTUP_TIME
2929
)
3030
_S4L_STARTUP_SCREEN_MAX_TIME: Final[int] = 45 * SECOND
31-
31+
_S4L_COPY_WORKSPACE_TIME: Final[int] = 60 * SECOND
3232

3333
@dataclass(kw_only=True)
3434
class S4LWaitForWebsocket:
@@ -84,7 +84,7 @@ def __call__(self, message: str) -> bool:
8484
return False
8585

8686

87-
def launch_S4L(page: Page, node_id, log_in_and_out: WebSocket, autoscaled: bool) -> Dict[str, Union[WebSocket, FrameLocator]]:
87+
def launch_S4L(page: Page, node_id, log_in_and_out: WebSocket, autoscaled: bool, copy_workspace: bool = False) -> Dict[str, Union[WebSocket, FrameLocator]]:
8888
with log_context(logging.INFO, "launch S4L") as ctx:
8989
predicate = S4LWaitForWebsocket(logger=ctx.logger)
9090
with page.expect_websocket(
@@ -95,6 +95,11 @@ def launch_S4L(page: Page, node_id, log_in_and_out: WebSocket, autoscaled: bool)
9595
if autoscaled
9696
else _S4L_MAX_STARTUP_TIME
9797
)
98+
+ (
99+
_S4L_COPY_WORKSPACE_TIME
100+
if copy_workspace
101+
else 0
102+
)
98103
+ 10 * SECOND,
99104
) as ws_info:
100105
s4l_iframe = wait_for_service_running(
@@ -105,6 +110,11 @@ def launch_S4L(page: Page, node_id, log_in_and_out: WebSocket, autoscaled: bool)
105110
_S4L_AUTOSCALED_MAX_STARTUP_TIME
106111
if autoscaled
107112
else _S4L_MAX_STARTUP_TIME
113+
)
114+
+ (
115+
_S4L_COPY_WORKSPACE_TIME
116+
if copy_workspace
117+
else 0
108118
),
109119
press_start_button=False,
110120
)

tests/e2e-playwright/tests/sim4life/test_template.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def test_template(
3535
node_ids: list[str] = list(project_data["workbench"])
3636
assert len(node_ids) == 1, "Expected 1 node in the workbench!"
3737

38-
resp = launch_S4L(page, node_ids[0], log_in_and_out, autoscaled)
38+
resp = launch_S4L(page, node_ids[0], log_in_and_out, autoscaled, copy_workspace=True)
3939
s4l_websocket = resp["websocket"]
4040
s4l_iframe = resp["iframe"]
4141
interact_with_S4L(page, s4l_iframe)

0 commit comments

Comments
 (0)