Playwright Intermittent Connection Refused Error

As I have more tests in Playwright, the number of workers required grow and I happened to encounter the following error:

Error: page.goto: NS_ERROR_CONNECTION_REFUSED

And the tests that failed changes every time playwright test is run.

To solve this, I reduce the workers in playwright.config.ts.

from:

workers: process.env.CI ? 1 : undefined,

to:

workers: process.env.CI ? 1 : 8, //8 works fine for me. I will go smaller like 4 or 5 if the issue persists. This defines the max workers


Alternatively, workers can be set when running the test.

npx playwright test --workers 8


For more information:

https://playwright.dev/docs/test-parallel#limit-workers


Comments

Popular posts from this blog

Sentinel One Strikes Again. No internet connection. Uninstall Sentinel One Agent.

A2 Hosting Let's Encrypt Can't Install Certificate on ASP.NET Core Application

NuGet Package Reference NU6105 Publish Error