From e25e3c5697bb0fe54a0dfd3b07c3795abbfd7ea5 Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Fri, 8 May 2026 02:43:38 +0000 Subject: [PATCH] ci(windows): make --single-process Chromium darwin-only in playwright tests Chat UI Tests on windows-latest were dying at composer.wait_for(...) with playwright TargetClosedError "Locator.wait_for: Target page, context or browser has been closed". studio.log shows a clean POST /api/auth/change-password 200 followed by zero further requests -- the page died as soon as the React app navigated after the change-password submit. The root cause is the --single-process Chromium flag in _CHROMIUM_STABILITY_ARGS: it was added in commit fdf7f94f for the macos-14 free runner, where the browser <-> renderer IPC pipe was the actual crash site, but on windows-latest the IPC pipe is fine and forcing single-process strictly destabilises the browser -- any in-flight renderer crash takes the whole context down because there is no separate renderer process to recover into. Make the flag conditional on sys.platform == "darwin" in both playwright_chat_ui.py and playwright_extra_ui.py. Linux currently passes either way today, so we mirror the original commit's stated intent ("ci(mac): single-process Chromium") and only opt darwin in. The accompanying timeout / screenshot-best-effort comments stay correct -- they describe darwin-specific slowness that is still real on the macos-14 runner. Failing run for the record: 25522501202 / job 74909947457. --- tests/studio/playwright_chat_ui.py | 11 ++++++++++- tests/studio/playwright_extra_ui.py | 8 +++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/tests/studio/playwright_chat_ui.py b/tests/studio/playwright_chat_ui.py index 8ec5157d0e..57777c5cf5 100644 --- a/tests/studio/playwright_chat_ui.py +++ b/tests/studio/playwright_chat_ui.py @@ -132,8 +132,17 @@ with sync_playwright() as p: "--disable-dev-shm-usage", "--no-sandbox", "--disable-gpu", - "--single-process", ] + # --single-process is a macos-14 free-runner workaround. On + # windows-latest it is strictly destabilising: any renderer + # crash (including the React redirect after change-password) + # takes the entire browser context down, surfacing as + # TargetClosedError on the next Locator.wait_for. Run + # 25522501202 / job 74909947457 had the page die right after + # POST /api/auth/change-password 200 with this flag enabled. + # Linux passes either way today, so we only opt in on darwin. + if sys.platform == "darwin": + _CHROMIUM_STABILITY_ARGS.append("--single-process") browser = p.chromium.launch( headless = True, args = _CHROMIUM_STABILITY_ARGS, diff --git a/tests/studio/playwright_extra_ui.py b/tests/studio/playwright_extra_ui.py index ba32b47ee7..6742714e51 100644 --- a/tests/studio/playwright_extra_ui.py +++ b/tests/studio/playwright_extra_ui.py @@ -89,8 +89,14 @@ with sync_playwright() as p: "--disable-dev-shm-usage", "--no-sandbox", "--disable-gpu", - "--single-process", ] + # --single-process is darwin-only -- on windows-latest it + # collapses the renderer-isolation safety net and any in-flight + # crash (e.g. React redirect after change-password) takes the + # whole browser context down. Same rationale as + # playwright_chat_ui.py. + if sys.platform == "darwin": + _CHROMIUM_STABILITY_ARGS.append("--single-process") browser = p.chromium.launch( headless = True, args = _CHROMIUM_STABILITY_ARGS,