Skip to content

Commit 01be85c

Browse files
fix(ci): max concurrent suites during weval test
1 parent cfa1c4c commit 01be85c

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

test/vitest.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@ import { defineConfig } from 'vitest/config';
88
*/
99
const TIMEOUT_MS = process.env.CI ? 240_000 : 120_000;
1010

11+
/**
12+
* On relatively modest machines in CI when weval is enabled,
13+
* tests that use it (i.e. any test that does a build w/ enableAot) can
14+
* suffer from CPU resource contention.
15+
*/
16+
const MAX_CONCURRENT_SUITES =
17+
process.env.CI && process.env.WEVAL_TEST ? 1 : undefined;
18+
1119
const REPORTERS = process.env.GITHUB_ACTIONS
1220
? ['verbose', 'github-actions']
1321
: ['verbose'];
@@ -29,6 +37,16 @@ export default defineConfig({
2937
retry: RETRY,
3038
printConsoleTrace: true,
3139
passWithNoTests: false,
40+
/**
41+
* We use only one concurrent suite because tools like Weval
42+
* are very sensitive to other operations, and during tests
43+
* we will blow through timeouts and performance
44+
*
45+
* Inside individual suites, test.concurrent will still enable tests
46+
* to be run side-by-side (see TIMEOUT_MS and RETRY which enable
47+
* those tests to eventually pass despite increased load).
48+
*/
49+
maxConcurrentSuites: MAX_CONCURRENT_SUITES,
3250
include: ['test/**/*.js'],
3351
setupFiles: ['test/meta-resolve-stub.ts'],
3452
exclude: [

0 commit comments

Comments
 (0)