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.
This commit is contained in:
Teknium 2026-06-28 03:58:01 -07:00 committed by GitHub
parent 135f235165
commit 7968c90318
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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",