Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions tests/config/remoteServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,17 @@ export class RemoteServer implements PlaywrightServer {
await this._browser.close();
this._browser = undefined;
}
await this._process.kill('SIGINT');
await this.childExitCode();
// The launchServer child forwards SIGINT to gracefully close the browser and
// then exit. A headed browser can intermittently fail to terminate on SIGINT
// (observed on macOS chromium), which leaves the child alive and hangs
// teardown until the test timeout. Give graceful shutdown a chance, then
// escalate to SIGKILL so teardown stays bounded.
void this._process.kill('SIGINT');
const killTimer = setTimeout(() => void this._process.kill('SIGKILL'), 10000);
try {
await this.childExitCode();
} finally {
clearTimeout(killTimer);
}
}
}
Loading