mirror of
https://github.com/t8y2/dbx.git
synced 2026-10-19 16:16:45 +00:00
perf(test): raise local vitest workers to 8 with 10s timeout
The 4-worker cap existed only to keep deferred-promise tests inside Vitest's old 5s default when several workers pay the first dynamic import of the large store modules at once; a 10s testTimeout absorbs that without capping throughput. CI keeps 4 workers (4-vCPU runners already share CPU with vue-tsc/oxlint/oxfmt via pnpm check). Also add pnpm test:watch for incremental local runs.
This commit is contained in:
@@ -40,6 +40,7 @@
|
||||
"fmt": "oxfmt \"apps/desktop/src/**/*.{ts,vue}\"",
|
||||
"pretest": "pnpm generate:connection-types",
|
||||
"test": "vitest run",
|
||||
"test:watch": "vitest",
|
||||
"preview": "vite preview --config apps/desktop/vite.config.ts",
|
||||
"tauri": "tauri",
|
||||
"prepare": "husky"
|
||||
|
||||
+9
-4
@@ -13,9 +13,14 @@ export default defineConfig({
|
||||
test: {
|
||||
include: ["packages/app-tests/*.test.ts", "apps/desktop/src/**/*.spec.ts", "docs/lib/*.test.ts"],
|
||||
globalSetup: "packages/test-globals.ts",
|
||||
// Large store modules are dynamically imported in many specs. Limiting
|
||||
// concurrency prevents those imports from starving timers and making
|
||||
// otherwise deterministic deferred-promise tests exceed Vitest's timeout.
|
||||
maxWorkers: 4,
|
||||
// Many specs dynamically import the large store modules (connectionStore,
|
||||
// queryStore) inside test bodies; when several workers pay that first
|
||||
// import at once, CPU contention can stall a worker's event loop past the
|
||||
// old 5s default and flake deferred-promise tests. A 10s timeout absorbs
|
||||
// that without capping throughput, so workers can scale past 4. CI keeps
|
||||
// 4 workers: its 4-vCPU runners already run vue-tsc/oxlint/oxfmt
|
||||
// concurrently with vitest via `pnpm check`.
|
||||
testTimeout: 10_000,
|
||||
maxWorkers: process.env.CI ? 4 : 8,
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user