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);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Let's issue a second SIGINT instead - we should handle that situation by force-killing the browser.
  • 10s is too small, make it 30s.

try {
await this.childExitCode();
} finally {
clearTimeout(killTimer);
}
}
}
Loading