test(perf): reveal visibility control only on isolated CI display

This commit is contained in:
Neil
2026-09-21 15:05:16 -07:00
parent cf2d90f66c
commit 0054e578d4
2 changed files with 13 additions and 2 deletions
+2 -2
View File
@@ -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"
+11
View File
@@ -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) {