microsoft / playwright

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
https://playwright.dev
Apache License 2.0
65.74k stars 3.58k forks source link

[Question] Worker Error #13929

Closed imartinflores closed 2 years ago

imartinflores commented 2 years ago

Hey guys, just started a new project with PW 1.21 . I was trying to run only 1 test from the example.spec.js file, the test passes, however, I am getting this:

Worker teardown error. This worker ran 1 test: [chromium] > tests\example.spec.js:15:8 > New Todo > should allow me to add todo items

What could be the problem ? I have not made any modifications except removing some "Projects" from the config file and only left chromium. Thanks!

dgozman commented 2 years ago

@imartinflores Something unexpected happened during the run. Could you please run with DEBUG=pw:browser* environment variable set and post the logs here?

imartinflores commented 2 years ago

@dgozman Sure, here it is:

pw:browser <launched> pid=7508 +13ms
pw:browser [pid=7508] <gracefully close start> +3s

Worker teardown error. This worker ran 1 test:
[chromium] › tests\components\cookiebanner.spec.js:5:8 › Cookie Banner › should have text

  pw:browser [pid=7508] <kill> +30s
  pw:browser [pid=7508] <will force kill> +0ms
  pw:browser [pid=7508] taskkill stderr: SUCCESS: The process with PID 15552 (child process of PID 7508) has been terminated.
  pw:browser SUCCESS: The process with PID 21860 (child process of PID 7508) has been terminated.
  pw:browser SUCCESS: The process with PID 20828 (child process of PID 7508) has been terminated.
  pw:browser SUCCESS: The process with PID 7508 (child process of PID 9100) has been terminated.
  pw:browser  +181ms
  pw:browser [pid=7508] starting temporary directories cleanup +0ms
  pw:browser [pid=7508] exception while removing C:\Users\MARTIN~1.IGN\AppData\Local\Temp\playwright_chromiumdev_profile-py1UMv: Error: EPERM: operation not permitted, unlink 'C:\Users\MARTIN~1.IGN\AppData\Local\Temp\playwright_chromiumdev_profile-py1UMv\BrowserMetrics\BrowserMetrics-6272D8F3-1D54.pma' +17ms
pw:browser [pid=7508] finished temporary directories cleanup +0ms

  1 passed (38s)

Let me know if something else is needed. Currently, I am using a global-setup.js that opens a browser, context and page and navigate to the baseUrl indicated in the config file and "chrome" as a channel. There is no teardown rn. Also, is it possible to have a global teardown and receive the actual browser to close it ?

Thanks

imartinflores commented 2 years ago

@dgozman in fact, just realised that using "chrome" as channel is throwing that error. It does not happen with chromium. Thanks for the help!

dgozman commented 2 years ago

@imartinflores Most likely, when you use chrome channel, you also have Google Chrome running on your computer. You should close it before using with Playwright. Let me know if that helps.

imartinflores commented 2 years ago

@dgozman I tried closing the browser instances and also from the task manager. I am still seeing the same message and the time is longer than running in chromium. At the moment I am running 3 tests, 1 worker, but when I execute them and check the task manager, multiple instances of chrome are being created, is it normal ? could be a bug or any other thing causing this ? Thanks!

mxschmitt commented 2 years ago

Sorry for the late reply. So Google Chrome leads to a successful test execution but the worker ends up in a worker error?

imartinflores commented 2 years ago

@mxschmitt Hey! No problem at all, yes , that happened. (Have not tried it again btw, but can do it and provide feedback). But basically, when using chromium it works good. When using Chrome as channel, even closing all the chrome processes from the Task Manager, I got the same error. The browser is closed, and it takes a little bit longer to report the result in the terminal, finally, it passes, but says there was a problem with the worker. Thanks!

mxschmitt commented 2 years ago

To recap, you have a Windows machine, do you have enterprise policies applied there? Or do you know if your Chrome is restricted in any way? Which version of Chrome are you using btw.?

imartinflores commented 2 years ago

I do. Chrome is not restricted as far as I know. I am using Chrome Version 101.0.4951.67 , PW v1.21 - I will try upgrading PW first

mxschmitt commented 2 years ago

Could you try checking if there are any enterprise policies applied? chrome://policy

imartinflores commented 2 years ago

Sure btw, upgrading to PW 1.22 helped. The worker error is not happening now, however is reporting the test as as slow. I can double check that cause it could be the website or my machine I guess. In terms of policies, I've got:

ExtensionInstallForceList HomePageIsNewTabPage HomepageLocation RestoreOnStartup PopUpsAllowedForUrls RestoreOnStartupUrls AuthServerWhitelist LegacySameSiteCookieBehaviorEnabled PluginsAllowedForUrls

mxschmitt commented 2 years ago

Is everything working as intended now except the performance issues? Then lets follow-up on that in a new bug report with more details?

imartinflores commented 2 years ago

@mxschmitt yes, we can close this one and I will report it if need, thank you!, I m having some general performance issues now with my laptop, so will check everything and try to sort them out before opening a new bug just in case. Thanks for helping!