From 7968c9031887a44701d2f960f01c24486c7edfdf Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Sun, 28 Jun 2026 03:58:01 -0700 Subject: [PATCH] test(install): track run_with_timeout extraction after #39219 refactor (#54185) PR #39219 split run_browser_install_with_timeout into a thin wrapper that delegates to a new run_with_timeout helper (and parameterized the timeout binary as $timeout_bin for macOS gtimeout support), but did not update tests/test_install_sh_browser_install.py. The behavioral harness extracted only the now-empty wrapper, so the install command never ran (runs==[]), failing all 8 behavioral cases; two text assertions also still expected the old literal 'timeout' invocation. Fix the stale test: extract run_with_timeout alongside the wrapper, and match the $timeout_bin-parameterized GNU-timeout strings. Behavior unchanged. --- tests/test_install_sh_browser_install.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/test_install_sh_browser_install.py b/tests/test_install_sh_browser_install.py index 212bacfaa23..7881dad18a5 100644 --- a/tests/test_install_sh_browser_install.py +++ b/tests/test_install_sh_browser_install.py @@ -136,11 +136,12 @@ def test_browser_install_timeout_stays_interruptible() -> None: """ text = INSTALL_SH.read_text() - # GNU-flag probe + the guarded invocation must both be present. - assert "timeout --foreground -k 10 1 true" in text - assert 'timeout --foreground -k 10 "$timeout_seconds" "$@"' in text + # GNU-flag probe + the guarded invocation must both be present. The timeout + # binary is parameterized ($timeout_bin) so macOS gtimeout works too (#39219). + assert '"$timeout_bin" --foreground -k 10 1 true' in text + assert '"$timeout_bin" --foreground -k 10 "$timeout_seconds" "$@"' in text # Plain-timeout fallback preserved for BusyBox/non-GNU. - assert 'timeout "$timeout_seconds" "$@"' in text + assert '"$timeout_bin" "$timeout_seconds" "$@"' in text # --------------------------------------------------------------------------- @@ -161,8 +162,11 @@ def _run_install_fn(distro: str, version: str, *, native_fails: bool, the install command ran, and the override value seen on each run. """ # Extract the functions we need so we don't execute the whole installer. + # run_browser_install_with_timeout delegates to run_with_timeout (#39219), + # so the helper must be pulled in too or the install command never runs. fn_names = [ "run_browser_install_with_timeout", + "run_with_timeout", "playwright_host_unrecognized", "playwright_fallback_platform", "run_playwright_install",