microsoft / playwright

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
https://playwright.dev
Apache License 2.0
63.61k stars 3.44k forks source link

[Bug]: Firefox tests in macos 14 time out / take a long time #30705

Open canstand opened 1 month ago

canstand commented 1 month ago

Version

1.44.0

Steps to reproduce

Refer https://github.com/microsoft/playwright/actions/runs/8973892628

Expected behavior

The test job takes similar time under different macos versions.

Actual behavior

Test job in macos-14(firefox) timeout.

Additional context

No response

Environment

OS: macos 14
Browser: firefox
playwright: v1.44.0
mxschmitt commented 1 month ago

Looking at the recent commits, it always times out.

aslushnikov commented 1 month ago

Investigation notes

We see that the frameAttached event for the main frame takes 5 seconds to arrive. This might be related to the slow-down to create a new process for the page. We only see this happenning under the following circumstances:

History: Firefox was timing out on macos-14 since the test bots were introduced: https://github.com/microsoft/playwright/commit/4affcdef71624e9c0982f9eb5be19c7e4d2251ab

Reproduction:

Github Actions provide different architectures for the different size runners (details here and here):

Locally, on my macbook with MacOS-14 and aarch64 - ✅ works as intended.

WebDriver script ```ts const { Builder } = require('selenium-webdriver'); const firefox = require('selenium-webdriver/firefox'); (async function example() { let options = new firefox.Options(); // Enable BiDi options.setPreference('remote.bidi.enabled', true); let driver = await new Builder() .forBrowser('firefox') .setFirefoxOptions(options) .build(); try { // Navigate to a URL await driver.get('about:blank'); } finally { // Close the browser await driver.quit(); } })(); ```
Puppeteer Firefox script ```ts // make sure to run `npx puppeteer browsers install firefox` beforehand import pptr from 'puppeteer'; const browser = await pptr.launch({ product: 'firefox', }); // Open a new page const page = await browser.newPage(); await page.close(); await browser.close(); ```

The easiest reproduction so far is just running the headless screenshot:

/Applications/Firefox.app/Contents/MacOS/firefox --headless --screenshot /tmp/foo.png about:blank
aslushnikov commented 1 month ago

This seems to be an issue with Apple Silicon virtualization + Firefox.

mxschmitt commented 3 weeks ago

Note: We temporarily mitigated it for now by continuing to use macOS Intel for our testing infrastructure in order to not loose any test coverage. In https://github.com/microsoft/playwright/pull/31121.

aslushnikov commented 1 week ago

Note: this seems to be fixed with the latest Firefox Beta 128