Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

fix(test-runner): fix RangeError when running thousands of tests (#37946)

Rodrigo Mourac7900ccd0014
diff --git a/packages/playwright/src/runner/loadUtils.ts b/packages/playwright/src/runner/loadUtils.ts
index e61a2cca86..192bdc9978 100644
--- a/packages/playwright/src/runner/loadUtils.ts
+++ b/packages/playwright/src/runner/loadUtils.ts
@@ -184,7 +184,8 @@ export async function createRootSuite(testRun: TestRun, errors: TestError[], sho
for (const projectSuite of rootSuite.suites) {
// Split beforeAll-grouped tests into "config.shard.total" groups when needed.
// Later on, we'll re-split them between workers by using "config.workers" instead.
- testGroups.push(...createTestGroups(projectSuite, config.config.shard.total));
+ for (const group of createTestGroups(projectSuite, config.config.shard.total))
+ testGroups.push(group);
}
// Shard test groups.