[{"data":1,"prerenderedAt":120},["ShallowReactive",2],{"/2026/02/10-playwright-intermittent-connection-refused-error":3},{"id":4,"title":5,"body":6,"date":111,"description":44,"extension":112,"meta":113,"navigation":114,"path":115,"robots":116,"seo":117,"stem":118,"__hash__":119},"posts/2026/02/10 Playwright-intermittent-connection-refused-error.md","10 Playwright Intermittent Connection Refused Error",{"type":7,"value":8,"toc":108},"minimark",[9,18,25,28,31,45,47,50,52,55,58,66,68,71,79,81,84,92,95],[10,11,13],"post-title",{":date":12},"date",[14,15,17],"h1",{"id":16},"playwright-intermittent-connection-refused-error","Playwright Intermittent Connection Refused Error",[19,20,21],"notes",{},[22,23,24],"p",{},"This is a repost from my old blog. First posted in 2/26/2025.",[26,27],"br",{},[22,29,30],{},"As I have more tests in Playwright, the number of workers required grow and I happened to encounter the following error:",[32,33,34],"code-block",{},[35,36,41],"pre",{"className":37,"code":39,"language":40},[38],"language-text","Error: page.goto: NS_ERROR_CONNECTION_REFUSED\n","text",[42,43,39],"code",{"__ignoreMap":44},"",[26,46],{},[22,48,49],{},"And the tests that failed changes every time playwright test is run.",[26,51],{},[22,53,54],{},"To solve this, I reduce the workers in playwright.config.ts.",[22,56,57],{},"from:",[32,59,60],{},[35,61,64],{"className":62,"code":63,"language":40},[38],"workers: process.env.CI ? 1 : undefined,\n",[42,65,63],{"__ignoreMap":44},[26,67],{},[22,69,70],{},"to:",[32,72,73],{},[35,74,77],{"className":75,"code":76,"language":40},[38],"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\n",[42,78,76],{"__ignoreMap":44},[26,80],{},[22,82,83],{},"Alternatively, workers can be set when running the test.",[32,85,86],{},[35,87,90],{"className":88,"code":89,"language":40},[38],"npx playwright test --workers 8\n",[42,91,89],{"__ignoreMap":44},[22,93,94],{},"For more information:",[22,96,97],{},[98,99,102],"span",{"className":100},[101],"text-blue-600",[103,104,105],"a",{"href":105,"rel":106},"https://playwright.dev/docs/test-parallel#limit-workers",[107],"nofollow",{"title":44,"searchDepth":109,"depth":109,"links":110},2,[],"2026-02-10T00:00:00.000Z","md",{},true,"/2026/02/10-playwright-intermittent-connection-refused-error",null,{"title":5,"description":44},"2026/02/10 Playwright-intermittent-connection-refused-error","AVrXP8Gybc79ajLaZaDhIZgFTOmESRc_Q7Na-rgrpx4",1785167451496]