test(install-e2e): capture native Playwright handoff teardown

This commit is contained in:
ethernet
2026-09-06 21:44:59 -04:00
parent 86110e821c
commit 39b5ea6d0a
+10 -1
View File
@@ -19,6 +19,8 @@
const path = require('node:path')
const fs = require('node:fs')
// Capture Playwright's native process teardown in disposable CI evidence.
if (process.env.GITHUB_ACTIONS === 'true') process.env.DEBUG = 'pw:browser'
const { _electron } = require('@playwright/test')
const { prepareWindowForInput } = require('./window-input.cjs')
const { observeProcessClose } = require('./process-close.cjs')
@@ -95,6 +97,8 @@ async function main() {
timeout: 120_000
})
const child = app.process()
child.on('exit', (code, signal) => log(`launch process exit code=${code} signal=${signal}`))
child.on('close', (code, signal) => log(`launch process close code=${code} signal=${signal}`))
const waitForProcessClose = observeProcessClose(child)
log(`launched Electron pid=${child.pid}`)
@@ -322,7 +326,12 @@ async function main() {
// A marker appears before Electron exits. Exiting this driver at that point
// lets Playwright taskkill the entire tree, including the detached updater.
await waitForProcessClose()
try {
await waitForProcessClose()
} catch (error) {
log(`launch process state: exitCode=${child.exitCode} signalCode=${child.signalCode} killed=${child.killed}`)
throw error
}
log('Electron process closed — detached updater owns the rest')
}