···11-# TEMPORARY (PR-only, removed before merge): measures the pool's adaptive
22-# worker scaling on/off on the platforms where worker spawn costs differ the
33-# most. Windows is the interesting one — process spawn is several times more
44-# expensive there.
55-name: bench-adaptive
66-77-on:
88- pull_request:
99- paths:
1010- - .github/workflows/bench-adaptive.yml
1111- - scripts/bench-adaptive.mjs
1212- - 'packages/vitest/src/node/pools/**'
1313- workflow_dispatch:
1414-1515-permissions: {}
1616-1717-jobs:
1818- bench:
1919- name: 'Bench: adaptive scaling, ${{ matrix.os }}'
2020- runs-on: ${{ matrix.os }}
2121- timeout-minutes: 40
2222-2323- strategy:
2424- matrix:
2525- os: [windows-latest, ubuntu-latest]
2626- fail-fast: false
2727-2828- steps:
2929- - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3030- with:
3131- persist-credentials: false
3232-3333- - uses: ./.github/actions/setup-and-cache
3434- with:
3535- node-version: 24
3636-3737- - name: Install
3838- run: pnpm i --filter '!docs'
3939-4040- - name: Build
4141- run: pnpm run build
4242-4343- - name: Bench
4444- run: node scripts/bench-adaptive.mjs
+1-4
packages/vitest/src/node/pools/pool.ts
···12121313const WORKER_START_TIMEOUT = 90_000
14141515-// escape hatch while the adaptive worker scaling is validated across platforms
1616-const isAdaptiveScalingEnabled = process.env.VITEST_POOL_ADAPTIVE !== '0'
1717-1815interface Options {
1916 distPath: string
2017 teardownTimeout: number
···9289 return
9390 }
94919595- if (isAdaptiveScalingEnabled && !this.canScheduleNext()) {
9292+ if (!this.canScheduleNext()) {
9693 // re-evaluated when the in-flight worker start settles or a task
9794 // finishes — both end with another `schedule()` call
9895 return