Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] MS Edge Chromium cannot end msedge.exe processes in HEAD mode #4465

Closed
helen3141 opened this issue Nov 17, 2020 · 6 comments
Closed

[BUG] MS Edge Chromium cannot end msedge.exe processes in HEAD mode #4465

helen3141 opened this issue Nov 17, 2020 · 6 comments

Comments

@helen3141
Copy link

helen3141 commented Nov 17, 2020

Context:

  • Playwright Version: tested on versions 1.6.1, 1.3.0 and 1.4.0

  • Operating System:
    Edition Windows 10 Enterprise
    Version 20H2
    Installed on ‎8/‎20/‎2020
    OS build 19042.630
    Experience Windows Feature Experience Pack 120.2212.31.0

  • Node.js version: v12.10.0

  • Browser: MS Edge Chromium Version 86.0.622.69

  • Extra: Jest v. 23.6 on Visual Studio Code

Code Snippet

Help us help you! Put down a short code snippet that illustrates your bug and
that we can run and debug locally. For example:

import { chromium } from "playwright";

import { getEdgePath } from "edge-paths";

jest.setTimeout(10000);
test("Basic Test", async () => {
    const browser = await chromium.launch({
        headless: false,
        executablePath: getEdgePath()
    });
    const context = await browser.newContext();
    const page = await context.newPage();
    await page.goto("https://www.google.com");
    await page.close();
    await context.close();
    await browser.close();
});

Describe the bug
If you run this test it will pass but then you will see
image

console.error node_modules/playwright/lib/server/helper.js:59
[Error: EPERM: operation not permitted, unlink '[userpath]\AppData\Local\Temp\playwright_chromiumdev_profile-IAueWz\CrashpadMetrics-active.pma'] {
errno: -4048,
code: 'EPERM',
syscall: 'unlink',
path: '[userpath]\AppData\Local\Temp\playwright_chromiumdev_profile-IAueWz\CrashpadMetrics-active.pma'
}
This error won't occur if you run the test in head mode.

And if you open task manager you will see two msedge.exe processes that haven't ended <-- This issue is specific to Edge browser I believe

@helen3141
Copy link
Author

Update: I tried running a similar test on Selenium and got the dangling msedge.exe processes there as well. So that appears to be an Edge issue.

However, the console error message is specific to Playwright. Can you look into it?

@pavelfeldman
Copy link
Member

It looks like Edge is holding on to a crashpad file while we are closing the browser. It might be that the browser crashes while being closed too. Could you run the same with the DEBUG=pw:browser* environment variable set?

@helen3141
Copy link
Author

Similar results with this test:

import { chromium } from "playwright";
import { getEdgePath } from "edge-paths";

jest.setTimeout(10000);

process.env.DEBUG = "pw:browser*";
test("Basic Test", async () => {
    const browser = await chromium.launch({
        headless: false,
        executablePath: getEdgePath()
    });
    const context = await browser.newContext();
    const page = await context.newPage();
    await page.goto("https://www.google.com");
    await page.close();
    await context.close();
    await browser.close();
});

image

@pavelfeldman
Copy link
Member

pavelfeldman commented Dec 1, 2020

I just tried the following snippet and it works just fine

const { chromium } = require('playwright');

(async () => {
  const browser = await chromium.launch({
    headless: false,
    executablePath: 'C:\\Program Files (x86)\\Microsoft\\Edge Dev\\Application\\88.0.702.0\\msedge.exe'
  });
  const context = await browser.newContext();
  const page = await context.newPage();
  await page.goto("https://www.theverge.com");
  await page.close();
  await context.close();
  await browser.close();
})();

This makes me think that jest-playwright is the issue. You can try @playwright/test as a replacement, you would need to override the browserOptions fixture to set the executable path to MS Edge, otherwise it should work out of the box.

@pavelfeldman
Copy link
Member

Here is the snippet:

import { folio, expect } from "@playwright/test";

// We'll be extending standard folio.
const fixtures = folio.extend();
// Overriding browser options with executable path.
fixtures.browserOptions.override(async ({ browserOptions }, test) => {
  await test({
    ...browserOptions,
    executablePath: 'C:\\Program Files (x86)\\Microsoft\\Edge Dev\\Application\\88.0.702.0\\msedge.exe'
  });
});
// Instead of testing all browsers, override it to only run Chromium.
folio.generateParametrizedTests('browserName', ['chromium']);

// Now the test itself, the code above can be required from a utility file.
const { it } = fixtures.build();

it("test google page", async ({ page }) => {
  await page.goto("https://www.google.com");
  expect(await page.title()).toContain('Google');
});

@helen3141
Copy link
Author

After updating Edge Chromium to version 87, I no longer see this issue (even in jest). Please feel free to close this issue. Thanks for your time!

@yury-s yury-s closed this as completed Dec 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants