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]: Firefox tests in macos 14 time out / take a long time #30705

Open
canstand opened this issue May 8, 2024 · 3 comments
Open

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

canstand opened this issue May 8, 2024 · 3 comments
Assignees
Labels
browser-firefox upstream This is a bug in something playwright depends on, like a browser. v1.45

Comments

@canstand
Copy link

canstand commented May 8, 2024

Version

1.44.0

Steps to reproduce

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

  • All jobs of firefox in macos-14 (macos-latest) timeout after 1h30m
  • Jobs of firefox in macos-12(or macos-13) only took about 30m

(another proof: https://github.com/canstand/playwright-go/actions/runs/8999400053/job/24721476663 )

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
Copy link
Member

Looking at the recent commits, it always times out.

@mxschmitt mxschmitt changed the title [Bug]: Firefox tests in macos 14 take an unusually long time [Bug]: Firefox tests in macos 14 time out May 19, 2024
@mxschmitt mxschmitt changed the title [Bug]: Firefox tests in macos 14 time out [Bug]: Firefox tests in macos 14 time out / take a long time May 19, 2024
@aslushnikov
Copy link
Collaborator

aslushnikov commented May 20, 2024

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:

  • in Firefox
  • with MacOS 14
  • on Github Actions

History: Firefox was timing out on macos-14 since the test bots were introduced: 4affcde

Reproduction:

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

  • macos-14 is aarch64 - ❌ has 5 seconds delay for each newPage
  • macos-14-large is x86-64 - ✅ works as intended
  • macos-14-xlarge is aarch64 - ❌ has 5 seconds delay for each newPage

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

  • This behavior reproduces with pptr-firefox with Firefox nightly, and webdriver-bidi with Firefox Stable
WebDriver script
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
// 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
Copy link
Collaborator

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

@mxschmitt mxschmitt added upstream This is a bug in something playwright depends on, like a browser. browser-firefox labels May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
browser-firefox upstream This is a bug in something playwright depends on, like a browser. v1.45
Projects
None yet
Development

No branches or pull requests

4 participants