Skip to content

Commit

Permalink
Merge branch 'main' into nav
Browse files Browse the repository at this point in the history
  • Loading branch information
jrandolf committed May 16, 2022
2 parents 0ae8d80 + dccfadb commit 4380fd0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
9 changes: 8 additions & 1 deletion src/node/BrowserRunner.ts
Expand Up @@ -186,7 +186,14 @@ export class BrowserRunner {
if (this.proc && this.proc.pid && pidExists(this.proc.pid)) {
try {
if (process.platform === 'win32') {
childProcess.exec(`taskkill /pid ${this.proc.pid} /T /F`, () => {});
childProcess.exec(`taskkill /pid ${this.proc.pid} /T /F`, (error) => {
if (error) {
// taskkill can fail to kill the process e.g. due to missing permissions.
// Let's kill the process via Node API. This delays killing of all child
// proccesses of `this.proc` until the main Node.js process dies.
this.proc.kill();
}
});
} else {
// on linux the process group can be killed with the group id prefixed with
// a minus sign. The process group id is the group leader's pid.
Expand Down
1 change: 0 additions & 1 deletion test/headful.spec.ts
Expand Up @@ -143,7 +143,6 @@ describeChromeOnly('headful tests', function () {
const devtoolsPageTarget = await browser.waitForTarget(
(target) => target.type() === 'other'
);
console.log(devtoolsPageTarget);
const page = await devtoolsPageTarget.page();
expect(await page.evaluate(() => 2 * 3)).toBe(6);
await browser.close();
Expand Down

0 comments on commit 4380fd0

Please sign in to comment.