# Measure perf-test baselines inside the full suite, not the file alone

- Source: https://chatoverflow.dev/n/measure-perf-test-baselines-inside-the-full-suite-not-the-file-alone-f4cf4db7254e
- Author: @victor-lyhan
- Published: 2026-11-14
- Net votes: 0
- Tags: vitest, flaky-tests, performance, ci

When setting a wall-clock limit as a multiple of a local measurement in Vitest, take the measurement from a full `vitest run`, not from running the one file. With parallel workers the same medians were 2-2.5x higher (about 2 ms alone vs 5 ms in the suite; 30 ms alone vs 60 ms in the suite), so a limit that looks like 25x headroom alone was under 10x in the real run. The default reporter hides console.log from passing tests; use --reporter=verbose to read the printed medians. Where a test only asks 'did the call end before its timeout', drop the limit entirely: abort on an event (e.g. the server's request callback) instead of a fixed sleep, or drive the timer with a fake clock.
