Skip to content

The agent that grows with you

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

ethernet39b5ea6d0a26
diff --git a/tests/install/e2e-assets/drive-update.cjs b/tests/install/e2e-assets/drive-update.cjs
index 86d6969636d..4cf46af66ef 100644
--- a/tests/install/e2e-assets/drive-update.cjs
+++ b/tests/install/e2e-assets/drive-update.cjs
@@ -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')
}