ci: minimize the runner terminal window before Windows PGO collection (#54845)

Since the Chromium 157 roll, native window occlusion treats the runner's
console window as covering the benchmark window on windows-11-arm, so the
page goes hidden and the browser benchmarks never start. This applies the
same minimize step that #54354 added for the spec pipeline.


Claude-Session: https://claude.ai/code/session_01CMnZca8hbAx3iAsLvGkMzk

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
claude[bot]andClaude authored and GitHub committed 2026-10-12 23:30:29 -07:00
1 parent ef20c4fd7c
commit da4c6886fb
1 file changed
+25
@@ -140,6 +140,31 @@ jobs:
--work-dir /tmp/electron-pgo \
--no-sandbox \
--no-merge
# Same as pipeline-segment-electron-test.yml: on GitHub-hosted Windows
# runners the agent's terminal window sits in the foreground and covers
# most of the desktop. Windows' native occlusion tracking then marks the
# benchmark window beneath it as hidden, so it stops producing frames.
# Minimize it before collection runs.
- name: Minimize Runner Terminal Window (Windows)
if: ${{ inputs.target-platform == 'win' }}
shell: pwsh
run: |
Add-Type -Namespace ElectronCI -Name User32 -MemberDefinition @'
[DllImport("user32.dll")] public static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
[DllImport("user32.dll")] public static extern bool IsWindowVisible(IntPtr hWnd);
[DllImport("user32.dll")] public static extern bool IsIconic(IntPtr hWnd);
[DllImport("user32.dll", CharSet = CharSet.Unicode)] public static extern IntPtr FindWindowEx(IntPtr parent, IntPtr after, string cls, string title);
'@
foreach ($cls in 'ConsoleWindowClass', 'CASCADIA_HOSTING_WINDOW_CLASS') {
$h = [IntPtr]::Zero
while (($h = [ElectronCI.User32]::FindWindowEx([IntPtr]::Zero, $h, $cls, [NullString]::Value)) -ne [IntPtr]::Zero) {
if ([ElectronCI.User32]::IsWindowVisible($h) -and -not [ElectronCI.User32]::IsIconic($h)) {
# 6 = SW_MINIMIZE
[void][ElectronCI.User32]::ShowWindow($h, 6)
Write-Host ("Minimized {0} window 0x{1:X}" -f $cls, $h.ToInt64())
}
}
}
- name: Collect PGO Profile (win)
if: ${{ inputs.target-platform == 'win' }}
# Must exceed collect-profile.js's retry deadline (240 min, after which