Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions packages/web-platform/web-tests/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// LICENSE file in the root directory of this source tree.

import { defineConfig, devices } from '@playwright/test';
import os from 'node:os';

process.env['LIBGL_ALWAYS_SOFTWARE'] = 'true'; // https://github.com/microsoft/playwright/issues/32151
process.env['GALLIUM_HUD_SCALE'] = '1';
Expand All @@ -11,9 +12,17 @@ const enableMultiThread = !!process.env.ENABLE_MULTI_THREAD;
const enableSSR = !!process.env.ENABLE_SSR;
const testFPOnly = !!process.env.TEST_FP_ONLY;
const port = process.env.PORT ?? 3080;
const workerLimit = process.env['cpu_limit']
? Math.floor(parseFloat(process.env['cpu_limit']) / 2)
: undefined;
const workerLimit = Math.floor(((cpuCount, envCPULimit) => {
if (envCPULimit) {
return envCPULimit / 2;
} else {
if (cpuCount <= 32) {
return cpuCount / 2;
} else {
return 16 + (cpuCount - 32) / 6;
}
}
})(os.cpus().length, parseFloat(process.env['cpu_limit'] ?? '0')));

const testMatch: string | undefined = (() => {
if (testFPOnly) {
Expand Down
Loading