playwright: [BUG] browserType.launch: Protocol error (Browser.enable): Browser closed

Context:

  • Playwright Version: 1.17.1
  • Operating System: Mac
  • Node.js version: 14.x
  • Browser: All
  • Extra: Azure pipelines CI run

Code Snippet

playwright.chromium.launch();

Describe the bug

We had a failing Azure pipelines CI run in https://dev.azure.com/monacotools/Monaco/_build/results?buildId=148061&view=logs&j=3792f238-f35e-5f82-0dbc-272432d9a0fb&t=0d7e5bc9-922f-51dd-b06a-a90d0b9feeeb&l=13 with the following output printed:

Starting: Run unit tests (Browser, Chromium & Firefox & Webkit)
==============================================================================
Task         : Command line
Description  : Run a command line script using Bash on Linux and macOS and cmd.exe on Windows
Version      : 2.182.0
Author       : Microsoft Corporation
Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/command-line
==============================================================================
Generating script.
========================== Starting Command Output ===========================
/bin/bash --noprofile --norc /Users/runner/work/_temp/0b41947a-56e7-4f3d-ba2f-309cb70379dc.sh
yarn run v1.22.17
$ node test/unit/browser/index.js --build --browser chromium --browser webkit --browser firefox --tfs 'Browser Unit Tests'
browserType.launch: Protocol error (Browser.enable): Browser closed.
==================== Browser output: ====================
<launching> /Users/runner/Library/Caches/ms-playwright/firefox-1304/firefox/Nightly.app/Contents/MacOS/firefox -no-remote -headless -profile /var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/playwright_firefoxdev_profile-8oqYFV -juggler-pipe -silent
<launched> pid=11682
[pid=11682][err] *** You are running in headless mode.
=========================== logs ===========================
<launching> /Users/runner/Library/Caches/ms-playwright/firefox-1304/firefox/Nightly.app/Contents/MacOS/firefox -no-remote -headless -profile /var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/playwright_firefoxdev_profile-8oqYFV -juggler-pipe -silent
<launched> pid=11682
[pid=11682][err] *** You are running in headless mode.
============================================================
    at runTestsInBrowser (/Users/runner/work/1/s/test/unit/browser/index.js:127:48)
    at /Users/runner/work/1/s/test/unit/browser/index.js:239:17
    at /Users/runner/work/1/s/test/unit/browser/index.js:237:32 {
  name: 'Error'
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
##[error]Bash exited with code '1'.
Finishing: Run unit tests (Browser, Chromium & Firefox & Webkit)

Asking here for advice if there is something we can do about it.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 1
  • Comments: 37 (18 by maintainers)

Commits related to this issue

Most upvoted comments

Pushed to main, will report back how it goes next week.

After discussion with team we have decided to stop running builds in parallel in our CI machines. Will report back how that goes over coming days.

If there is some debug flags I can enable, please let me know.

@bpasero can you please setup a DEBUG=*browser* env variable when running firefox tests? It might give us some idea on what’s going on.

I do not think that is an option, after all this is our main Azure pipeline for building and we do not offer SSH access to that as far as I can tell for security reasons.

If there is some debug flags I can enable, please let me know.

Btw not sure if related, but in another run (not Firefox), I just got this now:

/bin/bash --noprofile --norc /Users/runner/work/_temp/62abe272-5a2a-4120-9451-c16d46ed8e96.sh
yarn run v1.22.17
$ node test/unit/browser/index.js --build --browser chromium --browser webkit --tfs 'Browser Unit Tests'
browserType.launch: Executable doesn't exist at /Users/runner/Library/Caches/ms-playwright/chromium-939194/chrome-mac/Chromium.app/Contents/MacOS/Chromium
╔═════════════════════════════════════════════════════════════════════════╗
║ Looks like Playwright Test or Playwright was just installed or updated. ║
║ Please run the following command to download new browsers:              ║
║                                                                         ║
║     npx playwright install                                              ║
║                                                                         ║
║ <3 Playwright Team                                                      ║
╚═════════════════════════════════════════════════════════════════════════╝
    at runTestsInBrowser (/Users/runner/work/1/s/test/unit/browser/index.js:127:48)
    at /Users/runner/work/1/s/test/unit/browser/index.js:239:17
    at /Users/runner/work/1/s/test/unit/browser/index.js:237:32 {
  name: 'Error'
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
##[error]Bash exited with code '1'.
Finishing: Run unit tests (Browser, Chromium & Webkit)

@bpasero scheduled for jan 2022!