Describe the bug
After upgrading from Vitest v3 to v4, there are two issues:
- Incorrect test duration reporting
- Tests that clearly run sequentially (~10s each) are reported as taking ~20s each.
- The total suite duration is correct, but per-test timings are inflated.
- Perceived performance regression
- Our full test suite (~300 tests) increased from ~42s (v3) to ~166s (v4).
- This appears unrelated to the reporting issue, but may be connected to concurrency changes in v4.
Expected:
- Each test should report its actual execution time (~10s in the example).
- Test runtime should remain roughly consistent with v3 under equivalent config.
Actual:
- Each test reports the total elapsed time of the suite segment (~20s).
- Suite runtime is significantly slower in v4.
Reproduction
import { describe, it } from 'vitest';
const delay = (ms: number) => new Promise((r) => setTimeout(r, ms));
describe.concurrent('Blah', () => {
it('1', async () => {
console.log('Started test 1');
await delay(10000);
console.log('Finished test 1');
});
it('2', async () => {
console.log('Started test 2');
await delay(10000);
console.log('Finished test 2');
});
});
Vitest config:
import { defineConfig } from 'vitest/config';
export default defineConfig({
test: {
include: ['tests/**/*.test.ts'],
maxConcurrency: 1,
maxWorkers: 1,
},
});
Observed output:
Started test 1
Finished test 1
Started test 2
Finished test 2
✓ 1 ~20s
✓ 2 ~20s
Even though each test only waits 10s.
Full reproduction (StackBlitz):
https://stackblitz.com/edit/vitest-dev-vitest-1p3gv87f?file=vite.config.ts
System Info
System:
OS: macOS 26.3
CPU: (18) arm64 Apple M5 Pro
Memory: 447.06 MB / 48.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 24.0.2 - /Users/dbousamra/.nvm/versions/node/v24.0.2/bin/node
Yarn: 3.5.1 - /opt/homebrew/bin/yarn
npm: 11.3.0 - /Users/dbousamra/.nvm/versions/node/v24.0.2/bin/npm
pnpm: 10.11.0 - /Users/dbousamra/Library/pnpm/pnpm
bun: 1.3.3 - /Users/dbousamra/.bun/bin/bun
Deno: 2.5.6 - /Users/dbousamra/.deno/bin/deno
Browsers:
Chrome: 146.0.7680.178
Firefox: 148.0
Safari: 26.3
Used Package Manager
yarn
Validations
Describe the bug
After upgrading from Vitest v3 to v4, there are two issues:
Expected:
Actual:
Reproduction
Vitest config:
Observed output:
Even though each test only waits 10s.
Full reproduction (StackBlitz):
https://stackblitz.com/edit/vitest-dev-vitest-1p3gv87f?file=vite.config.ts
System Info
System: OS: macOS 26.3 CPU: (18) arm64 Apple M5 Pro Memory: 447.06 MB / 48.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 24.0.2 - /Users/dbousamra/.nvm/versions/node/v24.0.2/bin/node Yarn: 3.5.1 - /opt/homebrew/bin/yarn npm: 11.3.0 - /Users/dbousamra/.nvm/versions/node/v24.0.2/bin/npm pnpm: 10.11.0 - /Users/dbousamra/Library/pnpm/pnpm bun: 1.3.3 - /Users/dbousamra/.bun/bin/bun Deno: 2.5.6 - /Users/dbousamra/.deno/bin/deno Browsers: Chrome: 146.0.7680.178 Firefox: 148.0 Safari: 26.3Used Package Manager
yarn
Validations