question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Tests failing on Webkit / Webkit Mobile browsers in a Docker container

See original GitHub issue

Context:

  • Playwright Version: 1.21
  • Operating System: ms playwright docker 1.21.0-focal
  • Node.js version: [e.g. 12.22, 14.6]
  • Browser: WebKit
  • Extra: running in Docker container

Code Snippet just example code (it happens randomly for different tests)

test('Test document', async ({ page }) => {
    await page.goto('some page here');

    await expect(page.locator('.header-controls .header-controls__download')).not.toBeVisible();
});
...
        {
            name: 'webkit',
            use: { ...devices['Desktop Safari'] },
        },
        {
            name: 'webkit mobile',
            use: { ...devices['iPhone 12'] },
        },
...

Describe the bug

One or more tests fail constantly on the webkit/webkit mobile browser only when run in a docker container. I have no idea why, as it seems the tests are not even ran (perhaps it fails before browser is started). Tests fail in the Before Hooks and take <300ms to fail. Tests pass normally when ran outside docker (macOS).

  2 failed
    [webkit] › find.spec.ts:3:1 › Find text in document and navigate between results ===============
    [webkit mobile] › find.spec.ts:3:1 › Find text in document and navigate between results ========
  12 skipped
  43 passed (3m)
make: *** [docker-ci-playwright] Error 1
browser.newContext: Browser closed.
==================== Browser output: ====================
<launching> /ms-playwright/webkit-1630/pw_run.sh --inspector-pipe --headless --no-startup-window
<launched> pid=6278
[pid=6278][err] /ms-playwright/webkit-1630/pw_run.sh: line 21:  6326 Segmentation fault      (core dumped) WEBKIT_FORCE_COMPLEX_TEXT="1" "$MINIBROWSER" "$@"
[pid=6278] <process did exit: exitCode=139, signal=null>
[pid=6278] starting temporary directories cleanup
[pid=6278] finished temporary directories cleanup
browser.newContext: Browser closed.
==================== Browser output: ====================
<launching> /ms-playwright/webkit-1630/pw_run.sh --inspector-pipe --headless --no-startup-window
<launched> pid=9432
[pid=9432][err] WARNING: trying to load platform resource 'missingImage'
[pid=9432][err] /ms-playwright/webkit-1630/pw_run.sh: line 21:  9442 Segmentation fault      (core dumped) WEBKIT_FORCE_COMPLEX_TEXT="1" "$MINIBROWSER" "$@"

Maybe you have some ideas what we could do to stop them from failing randomly in Docker? We want to use PW in our CI pipeline but this is stopping us.

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
chenshy39commented, May 13, 2022

Is that can be something about your machine ran out of CPU caused? I also have this problem which is CPU issue, resolve by allocate more CPU cores in docker.

0reactions
pradeippcommented, Dec 21, 2022

I’m getting a similar issue in gitlab… the mobile safari tests are all failing right at the url navigation stage in the beginning. page.goto: Timeout 60000ms exceeded. The tests are passing for all other devices(3 web browsers and mobile chromium view)

I tried both 1.29.0 and 1.28.1 versions of playwright and the corresponding official docker image.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How To Run End-to-End Tests Using Playwright and Docker
When your report loads in the browser, you will observe that each test has been run on three browsers: Chromium, Firefox, and Webkit....
Read more >
Playwright on Sauce Labs
Playwright is a testing framework that you can use to test your web apps — either locally in Docker or remotely on Sauce...
Read more >
Getting Started with Headless Chrome - Chrome Developers
A headless browser is a great tool for automated testing and server environments where you don't need a visible UI shell. For example,...
Read more >
Fails to launch browser in cluster using playwright
I am trying to deploy playwright into a cluster using as docker image, Evrything works fine in local system but as ...
Read more >
Automated cross browser testing with Cypress - BrowserStack
Instant access to 30+ versions of Chrome, Edge, and Firefox, and easy parallelization for your automated testing with Cypress. Now with BrowserStack.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found