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

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.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 2
  • Comments: 15 (3 by maintainers)

Most upvoted comments

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.