perf: enable vitest fs module cache by default

This commit is contained in:
Peter Steinberger
2026-03-23 04:47:48 +00:00
parent 9378b31e08
commit 46a455d9e3
4 changed files with 24 additions and 5 deletions

View File

@@ -82,7 +82,8 @@ Think of the suites as “increasing realism” (and increasing flakiness/cost):
- Fast-local iteration note:
- `pnpm test:changed` runs the wrapper with `--changed origin/main`.
- The base Vitest config marks the wrapper manifests/config files as `forceRerunTriggers` so changed-mode reruns stay correct when scheduler inputs change.
- Use `OPENCLAW_VITEST_FS_MODULE_CACHE=1` for repeated local reruns on a stable branch when transform cost dominates.
- Vitest's filesystem module cache is now enabled by default for Node-side test reruns.
- Opt out with `OPENCLAW_VITEST_FS_MODULE_CACHE=0` or `OPENCLAW_VITEST_FS_MODULE_CACHE=false` if you suspect stale transform cache behavior.
- Perf-debug note:
- `pnpm test:perf:imports` enables Vitest import-duration reporting plus import-breakdown output.
- `pnpm test:perf:imports:changed` scopes the same profiling view to files changed since `origin/main`.

View File

@@ -39,7 +39,7 @@ For local PR land/gate checks, run:
If `pnpm test` flakes on a loaded host, rerun once before treating it as a regression, then isolate with `pnpm vitest run <path/to/test>`. For memory-constrained hosts, use:
- `OPENCLAW_TEST_PROFILE=low OPENCLAW_TEST_SERIAL_GATEWAY=1 pnpm test`
- `OPENCLAW_VITEST_FS_MODULE_CACHE=1 pnpm test:changed`
- `OPENCLAW_VITEST_FS_MODULE_CACHE=0 pnpm test:changed`
## Model latency bench (local keys)