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]: Increase S4L's timeout when there is a workspace to download #6338

Merged
merged 3 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
_EC2_STARTUP_MAX_WAIT_TIME + _S4L_DOCKER_PULLING_MAX_TIME + _S4L_MAX_STARTUP_TIME
)
_S4L_STARTUP_SCREEN_MAX_TIME: Final[int] = 45 * SECOND

_S4L_COPY_WORKSPACE_TIME: Final[int] = 60 * SECOND

@dataclass(kw_only=True)
class S4LWaitForWebsocket:
Expand Down Expand Up @@ -84,7 +84,7 @@ def __call__(self, message: str) -> bool:
return False


def launch_S4L(page: Page, node_id, log_in_and_out: WebSocket, autoscaled: bool) -> Dict[str, Union[WebSocket, FrameLocator]]:
def launch_S4L(page: Page, node_id, log_in_and_out: WebSocket, autoscaled: bool, copy_workspace: bool = False) -> Dict[str, Union[WebSocket, FrameLocator]]:
with log_context(logging.INFO, "launch S4L") as ctx:
predicate = S4LWaitForWebsocket(logger=ctx.logger)
with page.expect_websocket(
Expand All @@ -95,6 +95,11 @@ def launch_S4L(page: Page, node_id, log_in_and_out: WebSocket, autoscaled: bool)
if autoscaled
else _S4L_MAX_STARTUP_TIME
)
+ (
_S4L_COPY_WORKSPACE_TIME
if copy_workspace
else 0
)
+ 10 * SECOND,
) as ws_info:
s4l_iframe = wait_for_service_running(
Expand All @@ -105,6 +110,11 @@ def launch_S4L(page: Page, node_id, log_in_and_out: WebSocket, autoscaled: bool)
_S4L_AUTOSCALED_MAX_STARTUP_TIME
if autoscaled
else _S4L_MAX_STARTUP_TIME
)
+ (
_S4L_COPY_WORKSPACE_TIME
if copy_workspace
else 0
),
press_start_button=False,
)
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e-playwright/tests/sim4life/test_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def test_template(
node_ids: list[str] = list(project_data["workbench"])
assert len(node_ids) == 1, "Expected 1 node in the workbench!"

resp = launch_S4L(page, node_ids[0], log_in_and_out, autoscaled)
resp = launch_S4L(page, node_ids[0], log_in_and_out, autoscaled, copy_workspace=True)
s4l_websocket = resp["websocket"]
s4l_iframe = resp["iframe"]
interact_with_S4L(page, s4l_iframe)
Expand Down
Loading