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

AWS EC2 Can't Reach EC2 Metadata Service After Subnet Change

A2 Hosting with .NET Core 2.1

Xcode CodeSign Incorrectly States Password is Incorrect