Open beksajt opened 2 months ago
While the test looks good, I suspect something else is going wrong. I recommend the following:
dotnet test
. So we know its not something Visual Studio causes.DEBUG=pw:browser,pw:api
environment variable, this should give us more debug output about the browser launchFirefox run failed as expected, but chromium is hanging as previously (i waited 5min+) Attaching logs from two runs: firefox and chromium (msedge):
I see that you are using Microsoft Edge. Most likely on your system cooperate policies / Enterprise policies are applied which are preventing from running Playwright how it should, see here.
Could you try running it without the channel
option?
I tried without channel option and result is the same. Also i tried with playwright 1.39.0 (the same code, the same runsettings) And here is the log: chromium-edge-1.39.0.txt
The logs you shared are still using Edge - do you have logs with just Chromium (no channel)?
There you go no-channel-1.46.0.txt
Looking at the logs I observe that the directory cleanup seems to hang and then races with the 30s timer to kill the browser:
2024-09-10T11:07:19.901Z pw:browser [pid=9268] starting temporary directories cleanup 2024-09-10T11:07:49.188Z pw:browser [pid=9268]
It internally will retry when EBUSY
, EMFILE
, ENFILE
, ENOTEMPTY
, or EPERM
error is encountered during directory removal.
Do you have a special anti virus installed on your system? Enterprise policies should not play a role when you use just Chromium.
Nope, i dont use any special anti virus. When i downgrade nuget package to 1.39.0 test is finished with fail (as expected). Take a look a this log. There is an exception at the end, but at least it exits. no-channel-1.39.0.txt
I see, this is probably also the case except that we don't surface it anymore:
2024-09-10T11:03:35.922Z pw:browser [pid=14916] exception while removing C:\Users\$USER\AppData\Local\Temp\playwright_chromiumdev_profile-XXXXXXnNz44M: Error: EPERM: operation not permitted, unlink 'C:\Users\Konrad\AppData\Local\Temp\playwright_chromiumdev_profile-XXXXXXnNz44M\Default\Network\Cookies-journal'
Looks like Chromium keeps the file open / in busy state.
Version
1.46.0
Steps to reproduce
Expected behavior
Test result should be failed with exception:
Microsoft.Playwright.PlaywrightException : Page title expected to be 'xD'
Actual behavior
Test can't finish its job and spins forever:
Additional context
Found out that it happens only when chromium is set in runsettings. Firefox works ok.
Environment