Skip to content

Commit 379945d

Browse files
authored
update workers in CI (#14760)
1 parent 445eacd commit 379945d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

integration/playwright.config.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import * as os from "node:os";
2+
13
import type { PlaywrightTestConfig } from "@playwright/test";
24
import { devices } from "@playwright/test";
35

@@ -7,6 +9,8 @@ process.env.NODE_OPTIONS =
79
(process.env.NODE_OPTIONS ?? "") + ` --no-warnings=ExperimentalWarning`;
810

911
const isWindows = process.platform === "win32";
12+
let workers = Math.floor(os.cpus().length / 2);
13+
if (workers < 2) workers = 2;
1014

1115
const config: PlaywrightTestConfig = {
1216
testDir: ".",
@@ -18,8 +22,8 @@ const config: PlaywrightTestConfig = {
1822
},
1923
/* Maximum time one test can run for. */
2024
timeout: isWindows ? 60_000 : 30_000,
21-
fullyParallel: !(isWindows && process.env.CI),
22-
workers: isWindows && process.env.CI ? 1 : undefined,
25+
fullyParallel: true,
26+
workers,
2327
expect: {
2428
/* Maximum time expect() should wait for the condition to be met. */
2529
timeout: isWindows ? 10_000 : 5_000,

0 commit comments

Comments
 (0)