Skip to content

The agent that grows with you

test(pm): route build-deps PowerShell checks through the cold-runner helper

Hermes Agent5838f1372599
diff --git a/tests/pm/test_windows_build_deps.py b/tests/pm/test_windows_build_deps.py
index c550158125a..c25fbfbaf71 100644
--- a/tests/pm/test_windows_build_deps.py
+++ b/tests/pm/test_windows_build_deps.py
@@ -272,13 +272,11 @@ try { Install-HermesArm64OpenSSL -Vcpkg 'fixture-vcpkg' -Root $Root } catch {
if (-not $rejected -or $calls -ne 2) { throw 'damaged install was accepted' }
Write-Output 'PASS'
''', encoding="utf-8")
- env = dict(os.environ)
- env.setdefault("SystemRoot", r"C:\Windows")
- shell = shutil.which("powershell") or str(Path(env["SystemRoot"]) / "System32/WindowsPowerShell/v1.0/powershell.exe")
- result = subprocess.run(
- [shell, "-NoProfile", "-NonInteractive", "-ExecutionPolicy", "Bypass", "-File", str(script), str(HELPER), str(tmp_path)],
- capture_output=True, text=True, encoding="utf-8", errors="replace", env=env, timeout=30,
- )
+ # Real PowerShell child: routed through _powershell like the rest of this
+ # file. Its 180s budget exists because a real powershell.exe on a cold
+ # CI runner can exceed 30s (330ff28d44); these inline copies kept the old
+ # 30s timeout and timed out on cold ARM64 runners.
+ result = _powershell(script, HELPER, tmp_path)
assert result.returncode == 0, result.stdout + result.stderr
assert "PASS" in result.stdout
@@ -315,14 +313,7 @@ $executable = $resolved
if ($executable -isnot [string] -or $executable.Contains(' ')) { throw "joined path leaked: $executable" }
Write-Output 'PASS'
''', encoding="utf-8")
- env = dict(os.environ)
- env.setdefault("SystemRoot", r"C:\Windows")
- env.setdefault("ComSpec", str(Path(env["SystemRoot"]) / "System32/cmd.exe"))
- env.setdefault("PATHEXT", ".COM;.EXE;.BAT;.CMD")
- shell = shutil.which("powershell") or str(Path(env["SystemRoot"]) / "System32/WindowsPowerShell/v1.0/powershell.exe")
- result = subprocess.run(
- [shell, "-NoProfile", "-NonInteractive", "-ExecutionPolicy", "Bypass", "-File", str(script), str(HELPER), str(tmp_path)],
- capture_output=True, text=True, encoding="utf-8", errors="replace", env=env, timeout=30,
- )
+ # Same as above: the shared helper's cold-runner budget, not a stale 30s copy.
+ result = _powershell(script, HELPER, tmp_path)
assert result.returncode == 0, result.stdout + result.stderr
assert "PASS" in result.stdout