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] browserType.launch: Protocol error (Browser.enable): Browser closed #11130

Closed
bpasero opened this issue Dec 29, 2021 · 37 comments
Closed
Assignees

Comments

@bpasero
Copy link
Member

bpasero commented Dec 29, 2021

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.

@aslushnikov
Copy link
Collaborator

@bpasero I see this is Firefox crashing for you. A few questions:

  • does it happen reliably? If yes, can you please launch your tests with DEBUG=*browser* env variable?
  • do you have tracing / video recording enabled during this test run?

@bpasero
Copy link
Member Author

bpasero commented Dec 30, 2021

@aslushnikov

does it happen reliably? If yes, can you please launch your tests with DEBUG=browser env variable

Not on every run, but maybe once per week we get this

do you have tracing / video recording enabled during this test run?

Yup we do. We start/stop tracing per unit test and only persist it on failure.

Would it make sense to always set DEBUG=*browser* for our CI? And how is the output generated, on std out?

@Smrtnyk
Copy link

Smrtnyk commented Dec 30, 2021

I can confirm that I have the same issue and it happens just sometimes randomly, and only on firefox (we run chromium, webkit and ff)
I will observe when it happens again and collect the trace.

@bpasero
Copy link
Member Author

bpasero commented Dec 30, 2021

It just happened again, we will probably have to disable Firefox to get non-flaky test runs.

bpasero added a commit to microsoft/vscode that referenced this issue Dec 30, 2021
@aslushnikov
Copy link
Collaborator

@bpasero we recently fixed a significant bug related to tracing in firefox that resulted in 72% of all the crashes we see. Can you please try running with @playwright/test@next?

@bpasero
Copy link
Member Author

bpasero commented Dec 30, 2021

I would rather wait for a new official release from playwright if that is coming up soon?

@aslushnikov
Copy link
Collaborator

@bpasero scheduled for jan 2022!

@aslushnikov
Copy link
Collaborator

aslushnikov commented Jan 7, 2022

@bpasero we no longer think that we fixed it. Can you help us reproduce it? Maybe we can SSH into your hosted macOS runner and try reproduce it there?

@bpasero
Copy link
Member Author

bpasero commented Jan 8, 2022

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)

@aslushnikov
Copy link
Collaborator

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.

@bpasero
Copy link
Member Author

bpasero commented Jan 10, 2022

@aslushnikov

2022-01-10T16:10:13.8531680Z ##[section]Starting: Run unit tests (Browser, Chromium & Firefox & Webkit)
2022-01-10T16:10:13.8549190Z ==============================================================================
2022-01-10T16:10:13.8549950Z Task         : Command line
2022-01-10T16:10:13.8550580Z Description  : Run a command line script using Bash on Linux and macOS and cmd.exe on Windows
2022-01-10T16:10:13.8551130Z Version      : 2.182.0
2022-01-10T16:10:13.8551570Z Author       : Microsoft Corporation
2022-01-10T16:10:13.8552160Z Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/command-line
2022-01-10T16:10:13.8552780Z ==============================================================================
2022-01-10T16:10:14.3433170Z Generating script.
2022-01-10T16:10:14.3800670Z ========================== Starting Command Output ===========================
2022-01-10T16:10:14.4964720Z [command]/bin/bash --noprofile --norc /Users/runner/work/_temp/48c77c59-d5a4-4ec4-b9a4-c64f76b3bbd1.sh
2022-01-10T16:10:14.5808710Z yarn run v1.22.17
2022-01-10T16:10:14.8889950Z $ node test/unit/browser/index.js --build --browser chromium --browser webkit --browser firefox --tfs 'Browser Unit Tests'
2022-01-10T16:10:17.3027040Z 2022-01-10T16:10:17.242Z pw:browser <launching> /Users/runner/Library/Caches/ms-playwright/chromium-939194/chrome-mac/Chromium.app/Contents/MacOS/Chromium --disable-background-networking --enable-features=NetworkService,NetworkServiceInProcess --disable-background-timer-throttling --disable-backgrounding-occluded-windows --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-background-pages --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=ImprovedCookieControls,LazyFrameLoading,GlobalMediaControls,DestroyProfileOnBrowserClose,MediaRouter,AcceptCHFrame --allow-pre-commit-input --disable-hang-monitor --disable-ipc-flooding-protection --disable-popup-blocking --disable-prompt-on-repost --disable-renderer-backgrounding --disable-sync --force-color-profile=srgb --metrics-recording-only --no-first-run --enable-automation --password-store=basic --use-mock-keychain --no-service-autorun --enable-use-zoom-for-dsf=false --headless --hide-scrollbars --mute-audio --blink-settings=primaryHoverType=2,availableHoverTypes=2,primaryPointerType=4,availablePointerTypes=4 --no-sandbox --user-data-dir=/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/playwright_chromiumdev_profile-KwjDs1 --remote-debugging-pipe --no-startup-window
2022-01-10T16:10:17.3150720Z 2022-01-10T16:10:17.308Z pw:browser <launched> pid=3156
2022-01-10T16:10:17.3256480Z 2022-01-10T16:10:17.321Z pw:browser <launching> /Users/runner/Library/Caches/ms-playwright/webkit-1578/pw_run.sh --inspector-pipe --headless --no-startup-window
2022-01-10T16:10:17.6648040Z 2022-01-10T16:10:17.662Z pw:browser <launched> pid=3158
2022-01-10T16:10:17.6749600Z 2022-01-10T16:10:17.666Z pw:browser <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-urNPC6 -juggler-pipe -silent
2022-01-10T16:10:17.6851470Z 2022-01-10T16:10:17.680Z pw:browser <launched> pid=3160
2022-01-10T16:10:45.4422180Z 2022-01-10T16:10:45.435Z pw:browser [pid=3156][err] [0110/161045.433718:ERROR:command_buffer_proxy_impl.cc(125)] ContextResult::kTransientFailure: Failed to send GpuControl.CreateCommandBuffer.
2022-01-10T16:10:47.2995660Z 2022-01-10T16:10:47.280Z pw:browser [pid=3158] <gracefully close start>
2022-01-10T16:10:47.4150720Z 2022-01-10T16:10:47.281Z pw:browser [pid=3160] <gracefully close start>
2022-01-10T16:10:47.4254840Z 2022-01-10T16:10:47.283Z pw:browser [pid=3158] <kill>
2022-01-10T16:10:47.4355540Z 2022-01-10T16:10:47.284Z pw:browser [pid=3158] <will force kill>
2022-01-10T16:10:47.4458970Z 2022-01-10T16:10:47.292Z pw:browser [pid=3160] <kill>
2022-01-10T16:10:47.5415510Z 2022-01-10T16:10:47.292Z pw:browser [pid=3160] <will force kill>
2022-01-10T16:10:47.5520390Z 2022-01-10T16:10:47.295Z pw:browser [pid=3158] <process did exit: exitCode=null, signal=SIGKILL>
2022-01-10T16:10:47.5624800Z 2022-01-10T16:10:47.295Z pw:browser [pid=3158] starting temporary directories cleanup
2022-01-10T16:10:47.5728120Z 2022-01-10T16:10:47.304Z pw:browser [pid=3160] <process did exit: exitCode=null, signal=SIGKILL>
2022-01-10T16:10:47.5831530Z 2022-01-10T16:10:47.304Z pw:browser [pid=3160] starting temporary directories cleanup
2022-01-10T16:10:47.5934600Z 2022-01-10T16:10:47.307Z pw:browser [pid=3158] finished temporary directories cleanup
2022-01-10T16:10:47.6035140Z 2022-01-10T16:10:47.307Z pw:browser [pid=3158] <gracefully close end>
2022-01-10T16:10:47.6257260Z browserType.launch: Timeout 30000ms exceeded.
2022-01-10T16:10:47.6360200Z =========================== logs ===========================
2022-01-10T16:10:47.6463720Z <launching> /Users/runner/Library/Caches/ms-playwright/webkit-1578/pw_run.sh --inspector-pipe --headless --no-startup-window
2022-01-10T16:10:47.6566280Z <launched> pid=3158
2022-01-10T16:10:47.6668640Z ============================================================
2022-01-10T16:10:47.6771790Z     at runTestsInBrowser (/Users/runner/work/1/s/test/unit/browser/index.js:127:48)
2022-01-10T16:10:47.6873550Z     at /Users/runner/work/1/s/test/unit/browser/index.js:239:17
2022-01-10T16:10:47.6975230Z     at /Users/runner/work/1/s/test/unit/browser/index.js:237:32 {
2022-01-10T16:10:47.7070200Z   name: 'TimeoutError'
2022-01-10T16:10:47.7170980Z }
2022-01-10T16:10:47.7273520Z 2022-01-10T16:10:47.616Z pw:browser [pid=3156] <kill>
2022-01-10T16:10:47.7376630Z 2022-01-10T16:10:47.616Z pw:browser [pid=3156] <will force kill>
2022-01-10T16:10:47.7478010Z 2022-01-10T16:10:47.628Z pw:browser [pid=3156] starting temporary directories cleanup
2022-01-10T16:10:47.7580470Z 2022-01-10T16:10:47.630Z pw:browser [pid=3156] finished temporary directories cleanup
2022-01-10T16:10:47.7679670Z error Command failed with exit code 1.
2022-01-10T16:10:47.7781540Z info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
2022-01-10T16:10:47.9122840Z ##[error]Bash exited with code '1'.
2022-01-10T16:10:48.0583250Z ##[section]Finishing: Run unit tests (Browser, Chromium & Firefox & Webkit)

@bpasero
Copy link
Member Author

bpasero commented Jan 10, 2022

Oh, maybe that is not a Firefox run actually, looks like webkit?

But I really like this output, is there any harm just always running with these debug environment variable for all our runs across all platforms?

@aslushnikov
Copy link
Collaborator

But I really like this output, is there any harm just always running with these debug environment variable for all our runs across all platforms?

@bpasero No harm, but it's spammy :)

I see all the browsers are launched in parallel which makes them fight for system resources. This might be fine on a very powerful hardware, but in general this is slow and unrecommended.

Any chance you can try running these tests serially instead?

@bpasero
Copy link
Member Author

bpasero commented Jan 10, 2022

No that is not an option for us, because our builds are already very slow (more than 1h) and running tests in parallel was an explicit decision to speed up builds. We can always try to increase how beefy these machines are?

@aslushnikov
Copy link
Collaborator

We can always try to increase how beefy these machines are?

@bpasero yes, at least 2 CPU cores per browser. Or can you triple the machine count - and run one per browser? This is what we ourselves do.

@bpasero
Copy link
Member Author

bpasero commented Jan 11, 2022

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.

@aslushnikov aslushnikov added v1.19 and removed v1.18 labels Jan 11, 2022
@iOnline247
Copy link

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)

This is happening to me as well, but I'm using chromium inside docker (mcr.microsoft.com/playwright:focal)

@aslushnikov
Copy link
Collaborator

@iOnline247 this error might happen in all kinds of situations. Would you mind filing a separate issue with a description of what's going on?

@bpasero
Copy link
Member Author

bpasero commented Jan 14, 2022

Some new errors we see even after running sequentially:

From https://dev.azure.com/monacotools/Monaco/_build/results?buildId=150067&view=logs&j=3792f238-f35e-5f82-0dbc-272432d9a0fb&t=0d7e5bc9-922f-51dd-b06a-a90d0b9feeeb&l=15752

2022-01-13T21:39:22.2847110Z 2022-01-13T21:39:22.283Z pw:browser [pid=47133] <gracefully close start>
2022-01-13T21:39:22.3959850Z 2022-01-13T21:39:22.390Z pw:browser [pid=47133] <process did exit: exitCode=0, signal=null>
2022-01-13T21:39:22.4017810Z 2022-01-13T21:39:22.390Z pw:browser [pid=47133] starting temporary directories cleanup
2022-01-13T21:39:22.4305000Z 2022-01-13T21:39:22.429Z pw:browser [pid=47133] finished temporary directories cleanup
2022-01-13T21:39:22.4360920Z 2022-01-13T21:39:22.429Z pw:browser [pid=47133] <gracefully close end>
2022-01-13T21:39:22.4443200Z 2022-01-13T21:39:22.432Z pw:browser <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-RJPM17 -juggler-pipe -silent
2022-01-13T21:39:22.4611970Z 2022-01-13T21:39:22.460Z pw:browser <launched> pid=47334
2022-01-13T21:39:24.4798180Z 2022-01-13T21:39:24.478Z pw:browser [pid=47334][err] *** You are running in headless mode.
2022-01-13T21:39:24.6038940Z 2022-01-13T21:39:24.603Z pw:browser [pid=47334] <gracefully close start>
2022-01-13T21:39:24.6154710Z 2022-01-13T21:39:24.604Z pw:browser [pid=47334] <kill>
2022-01-13T21:39:24.6257630Z 2022-01-13T21:39:24.604Z pw:browser [pid=47334] <will force kill>
2022-01-13T21:39:24.6361050Z 2022-01-13T21:39:24.605Z pw:browser [pid=47334] exception while trying to kill process: Error: kill EPERM
2022-01-13T21:39:24.6461320Z 2022-01-13T21:39:24.606Z pw:browser [pid=47334] <process did exit: exitCode=null, signal=SIGSEGV>
2022-01-13T21:39:24.6536600Z 2022-01-13T21:39:24.606Z pw:browser [pid=47334] starting temporary directories cleanup
2022-01-13T21:39:24.6640400Z 2022-01-13T21:39:24.609Z pw:browser [pid=47334] finished temporary directories cleanup
2022-01-13T21:39:24.6740720Z 2022-01-13T21:39:24.609Z pw:browser [pid=47334] <gracefully close end>
2022-01-13T21:39:24.6843300Z browserType.launch: Protocol error (Browser.enable): Browser closed.
2022-01-13T21:39:24.6943770Z ==================== Browser output: ====================
2022-01-13T21:39:24.7041210Z <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-RJPM17 -juggler-pipe -silent
2022-01-13T21:39:24.7110600Z <launched> pid=47334
2022-01-13T21:39:24.7150970Z [pid=47334][err] *** You are running in headless mode.
2022-01-13T21:39:24.7213900Z =========================== logs ===========================
2022-01-13T21:39:24.7263210Z <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-RJPM17 -juggler-pipe -silent
2022-01-13T21:39:24.7297850Z <launched> pid=47334
2022-01-13T21:39:24.7327300Z [pid=47334][err] *** You are running in headless mode.
2022-01-13T21:39:24.7340130Z ============================================================
2022-01-13T21:39:24.7362280Z     at runTestsInBrowser (/Users/runner/work/1/s/test/unit/browser/index.js:128:48)
2022-01-13T21:39:24.7386120Z     at /Users/runner/work/1/s/test/unit/browser/index.js:244:25 {
2022-01-13T21:39:24.7407960Z   name: 'Error'
2022-01-13T21:39:24.7428090Z }
2022-01-13T21:39:24.7445620Z error Command failed with exit code 1.
2022-01-13T21:39:24.7471980Z info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
2022-01-13T21:39:24.7561960Z ##[error]Bash exited with code '1'.
2022-01-13T21:39:24.7582040Z ##[section]Finishing: Run unit tests (Browser, Chromium & Firefox & Webkit)

@aslushnikov
Copy link
Collaborator

process did exit: exitCode=null, signal=SIGSEGV

@bpasero and this now looks like something that was fixed! Let's see how it behaves with 1.18

@bpasero
Copy link
Member Author

bpasero commented Jan 14, 2022

Nice, is that version planned to be released soon?

@aslushnikov
Copy link
Collaborator

@bpasero 1.18.0-rc1 was just released; would you mind giving it a try?

npm i @playwright/test@1.18.0-rc1

@bpasero
Copy link
Member Author

bpasero commented Jan 14, 2022

Ok will try.

@bpasero
Copy link
Member Author

bpasero commented Jan 14, 2022

I am getting weird compile errors now:

~/Development/Microsoft/monaco> yarn --cwd test/integration/browser compile
yarn run v1.22.17
$ tsc
../../../node_modules/@playwright/test/types/test.d.ts:18:13 - error TS1005: '=' expected.

18 import type { APIRequestContext, Browser, BrowserContext, BrowserContextOptions, Page, LaunchOptions, ViewportSize, Geolocation, HTTPCredentials } from 'playwright-core';
               ~

../../../node_modules/@playwright/test/types/test.d.ts:18:153 - error TS1005: ';' expected.

18 import type { APIRequestContext, Browser, BrowserContext, BrowserContextOptions, Page, LaunchOptions, ViewportSize, Geolocation, HTTPCredentials } from 'playwright-core';
                                                                                                                                                           ~~~~~~~~~~~~~~~~~

../../../node_modules/@playwright/test/types/test.d.ts:19:13 - error TS1005: '=' expected.

19 import type { Expect } from './testExpect';
               ~

../../../node_modules/@playwright/test/types/test.d.ts:19:29 - error TS1005: ';' expected.

19 import type { Expect } from './testExpect';
                               ~~~~~~~~~~~~~~

../../../node_modules/@playwright/test/types/test.d.ts:21:1 - error TS1128: Declaration or statement expected.

21 export type { Expect } from './testExpect';
   ~~~~~~

../../../node_modules/@playwright/test/types/test.d.ts:21:13 - error TS1005: ';' expected.

21 export type { Expect } from './testExpect';
               ~

../../../node_modules/@playwright/test/types/test.d.ts:21:29 - error TS1005: ';' expected.

21 export type { Expect } from './testExpect';
                               ~~~~~~~~~~~~~~


Found 7 errors.

error Command failed with exit code 2.

Did anything change besides the package having moved to @playwright/test?

You should be able to reproduce that from https://github.com/microsoft/vscode/tree/ben/playwright-1.18 with the command: yarn --cwd test/integration/browser compile

@bpasero
Copy link
Member Author

bpasero commented Jan 15, 2022

Nevermind my above comment, I figured out a bad old TS dependency on our end.

@bpasero
Copy link
Member Author

bpasero commented Jan 15, 2022

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

@bpasero
Copy link
Member Author

bpasero commented Jan 19, 2022

Just came across this one:

2022-01-19T15:03:43.345Z pw:browser [pid=96985] <gracefully close start>
2022-01-19T15:03:43.520Z pw:browser [pid=96985] <process did exit: exitCode=0, signal=null>
2022-01-19T15:03:43.520Z pw:browser [pid=96985] starting temporary directories cleanup
2022-01-19T15:03:43.590Z pw:browser [pid=96985] finished temporary directories cleanup
2022-01-19T15:03:43.591Z pw:browser [pid=96985] <gracefully close end>
2022-01-19T15:03:43.601Z pw:browser <launching> /Users/runner/Library/Caches/ms-playwright/firefox-1313/firefox/Nightly.app/Contents/MacOS/firefox -no-remote -headless -profile /var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/playwright_firefoxdev_profile-85QEEK -juggler-pipe -silent
2022-01-19T15:03:43.627Z pw:browser <launched> pid=1198
2022-01-19T15:03:46.190Z pw:browser [pid=1198][err] *** You are running in headless mode.
2022-01-19T15:03:46.287Z pw:browser [pid=1198] <gracefully close start>
2022-01-19T15:03:46.288Z pw:browser [pid=1198] <kill>
2022-01-19T15:03:46.288Z pw:browser [pid=1198] <will force kill>
2022-01-19T15:03:46.289Z pw:browser [pid=1198] exception while trying to kill process: Error: kill EPERM
2022-01-19T15:03:46.289Z pw:browser [pid=1198] <process did exit: exitCode=null, signal=SIGSEGV>
2022-01-19T15:03:46.289Z pw:browser [pid=1198] starting temporary directories cleanup
2022-01-19T15:03:46.290Z pw:browser [pid=1198] finished temporary directories cleanup
2022-01-19T15:03:46.290Z pw:browser [pid=1198] <gracefully close end>
browserType.launch: Protocol error (Browser.enable): Browser closed.
==================== Browser output: ====================
<launching> /Users/runner/Library/Caches/ms-playwright/firefox-1313/firefox/Nightly.app/Contents/MacOS/firefox -no-remote -headless -profile /var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/playwright_firefoxdev_profile-85QEEK -juggler-pipe -silent
<launched> pid=1198
[pid=1198][err] *** You are running in headless mode.
=========================== logs ===========================
<launching> /Users/runner/Library/Caches/ms-playwright/firefox-1313/firefox/Nightly.app/Contents/MacOS/firefox -no-remote -headless -profile /var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/playwright_firefoxdev_profile-85QEEK -juggler-pipe -silent
<launched> pid=1198
[pid=1198][err] *** You are running in headless mode.
============================================================
    at runTestsInBrowser (/Users/runner/work/1/s/test/unit/browser/index.js:128:48)
    at /Users/runner/work/1/s/test/unit/browser/index.js:244:25 {
  name: 'Error'
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

@aslushnikov
Copy link
Collaborator

@bpasero so I tried running firefox multiple times, though I can't repro this. How often does the error happen these days? Also, can you please share the parameters of your mac runner? Maybe I can get a similar setup and see if things will repro.

@bpasero
Copy link
Member Author

bpasero commented Feb 4, 2022

We no longer run Firefox tests so I cannot answer that question.

Our Azure pipeline configuration is https://github.com/microsoft/vscode/blob/main/build/azure-pipelines/darwin/product-build-darwin.yml

@aslushnikov
Copy link
Collaborator

I so far still failed to repro this locally, but I'll try more!

@bpasero the azure pipeline you referred to has lots of secrets that are not accessible to me. Any instructions how to reproduce this locally as close as possible to your CI setup?

@autotestwannabe
Copy link

autotestwannabe commented Feb 11, 2022

Is there any workaround to run tests on Firefox and Webkit? unable to launch on windows 10.... and npx playwright install is giving perm error.

browserType.launch: Executable doesn't exist at C:<>\AppData\Local\ms-playwright\firefox-1313\firefox\firefox.exe
browserType.launch: Executable doesn't exist at C:<>AppData\Local\ms-playwright\webkit-1596\Playwright.exe

╔═════════════════════════════════════════════════════════════════════════╗
║ 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 ║
╚═════════════════════════════════════════════════════════════════════════╝

npx playwright install
Failed to install browsers
Error: Failed to download webkit v1596, caused by
Error: EPERM: operation not permitted, open 'C:<>\AppData\Local\ms-playwright\webkit-1596\Playwright.exe'

@iOnline247
Copy link

Is there any workaround to run tests on Firefox and Webkit? unable to launch on windows 10.... and npx playwright install is giving perm error.

browserType.launch: Executable doesn't exist at C:<>\AppData\Local\ms-playwright\firefox-1313\firefox\firefox.exe browserType.launch: Executable doesn't exist at C:<>AppData\Local\ms-playwright\webkit-1596\Playwright.exe

╔═════════════════════════════════════════════════════════════════════════╗ ║ 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 ║ ╚═════════════════════════════════════════════════════════════════════════╝

npx playwright install Failed to install browsers Error: Failed to download webkit v1596, caused by Error: EPERM: operation not permitted, open 'C:<>\AppData\Local\ms-playwright\webkit-1596\Playwright.exe'

I pinned the version to 1.15.0 and it went away, FWIW.

@aslushnikov
Copy link
Collaborator

@bpasero: I'm happy to come back to this is there's a good repro that we can easily run & debug locally. Otherwise, we're out ideas!

Everybody: most of the other comments here seem to be unrelated to the bug discussed. Please, file separate issues!

@jhanpiier
Copy link

image

hello! I try to lift on a ubuntu server, but it gives me this error :((((

@mxschmitt
Copy link
Member

image

hello! I try to lift on a ubuntu server, but it gives me this error :((((

You need to run it headless: true or with "xvfv-run npx playwright test".

@jhanpiier
Copy link

imagen ¡hola! Trato de levantar en un servidor ubuntu, pero me da este error :((((

Debe ejecutarlo sin cabeza: verdadero o con "prueba de dramaturgo xvfv-run npx".

image

@mxschmitt , It worked ! , but now I try to do it with dockers and it gives me an error, has it happened to you?

@mxschmitt
Copy link
Member

Lets file a new issue please, since this one is unrelated and continues to spam others.

@mxschmitt mxschmitt pinned this issue Apr 11, 2022
@mxschmitt mxschmitt unpinned this issue Apr 11, 2022
@microsoft microsoft locked and limited conversation to collaborators Apr 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants