From de6e87074c83bfbebf755d44e58b18f150108564 Mon Sep 17 00:00:00 2001 From: csa1234 Date: Mon, 26 Jan 2026 01:09:16 -0300 Subject: [PATCH] ci: adjust test configuration for stability and resource usage Reduce CI worker count to mitigate resource contention and increase timeouts to prevent flaky failures. Add Node.js memory limit and crash detection to parallel test runner for better error diagnostics. --- scripts/test-parallel.mjs | 6 ++++++ vitest.config.ts | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/scripts/test-parallel.mjs b/scripts/test-parallel.mjs index 242b444ff..8e3328aa5 100644 --- a/scripts/test-parallel.mjs +++ b/scripts/test-parallel.mjs @@ -37,6 +37,7 @@ const WARNING_SUPPRESSION_FLAGS = [ "--disable-warning=ExperimentalWarning", "--disable-warning=DEP0040", "--disable-warning=DEP0060", + "--max-old-space-size=4096", ]; const run = (entry) => @@ -54,6 +55,11 @@ const run = (entry) => }); children.add(child); child.on("exit", (code, signal) => { + if (signal === 'SIGKILL' || signal === 'SIGABRT' || signal === 'SIGSEGV') { + console.error(`Worker ${entry.name} crashed with signal ${signal} (possible OOM or resource exhaustion)`); + } else if (signal) { + console.warn(`Worker ${entry.name} terminated with signal ${signal}`); + } children.delete(child); resolve(code ?? (signal ? 1 : 0)); }); diff --git a/vitest.config.ts b/vitest.config.ts index 16c3b403a..358226c28 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -7,7 +7,7 @@ const repoRoot = path.dirname(fileURLToPath(import.meta.url)); const isCI = process.env.CI === "true" || process.env.GITHUB_ACTIONS === "true"; const isWindows = process.platform === "win32"; const localWorkers = Math.max(4, Math.min(16, os.cpus().length)); -const ciWorkers = isWindows ? 2 : 3; +const ciWorkers = isWindows ? 1 : 2; export default defineConfig({ resolve: { @@ -16,8 +16,8 @@ export default defineConfig({ }, }, test: { - testTimeout: 120_000, - hookTimeout: isWindows ? 180_000 : 120_000, + testTimeout: 300_000, + hookTimeout: isWindows ? 300_000 : 240_000, pool: "forks", maxWorkers: isCI ? ciWorkers : localWorkers, include: [