From 0054e578d475f1fbc44b45ea4460d946ffd02100 Mon Sep 17 00:00:00 2001 From: Neil Date: Mon, 21 Sep 2026 15:05:16 -0700 Subject: [PATCH] test(perf): reveal visibility control only on isolated CI display --- .github/workflows/terminal-perf.yml | 4 ++-- tests/e2e/terminal-perf-diagnostics.ts | 11 +++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/terminal-perf.yml b/.github/workflows/terminal-perf.yml index 55663071dce..8ad52012c45 100644 --- a/.github/workflows/terminal-perf.yml +++ b/.github/workflows/terminal-perf.yml @@ -102,9 +102,9 @@ jobs: mkdir -p "$RUNNER_TEMP/perf-evidence" for mode in hidden visible; do export ORCA_PERF_DIAGNOSTIC_RENDERER=swiftshader - export ORCA_E2E_FORCE_HEADFUL=0 + export ORCA_PERF_DIAGNOSTIC_XVFB_VISIBLE=0 if [ "$mode" = visible ]; then - export ORCA_E2E_FORCE_HEADFUL=1 + export ORCA_PERF_DIAGNOSTIC_XVFB_VISIBLE=1 fi export ORCA_PERF_DIAGNOSTIC_DIR="$RUNNER_TEMP/perf-evidence/mode-$mode" mkdir -p "$ORCA_PERF_DIAGNOSTIC_DIR" diff --git a/tests/e2e/terminal-perf-diagnostics.ts b/tests/e2e/terminal-perf-diagnostics.ts index c7a2e693132..6281e4ea67c 100644 --- a/tests/e2e/terminal-perf-diagnostics.ts +++ b/tests/e2e/terminal-perf-diagnostics.ts @@ -11,6 +11,17 @@ export function configureTerminalPerfDiagnostics(): void { } const visibility = await orcaPage.evaluate(() => document.visibilityState) const unthrottle = process.env.ORCA_PERF_DIAGNOSTIC_UNTHROTTLE === '1' + const visibleOnXvfb = process.env.ORCA_PERF_DIAGNOSTIC_XVFB_VISIBLE === '1' + if (visibleOnXvfb) { + if (process.platform !== 'linux' || !process.env.GITHUB_ACTIONS || !process.env.DISPLAY) { + throw new Error('Visible diagnostic requires an isolated GitHub Actions Xvfb display') + } + await electronApp.evaluate(({ BrowserWindow }) => { + for (const window of BrowserWindow.getAllWindows()) { + window.showInactive() + } + }) + } const windows = await electronApp.evaluate(({ BrowserWindow }, unthrottle) => { return BrowserWindow.getAllWindows().map((window) => { if (unthrottle) {