Skip to content

maxCurrency of zero hangs vitest #6599

@dcramer

Description

@dcramer

Describe the bug

set maxConcurrency to 0 in vitest's config and it seems to not spin up any workers

This appears to be behavior that was introduced somewhere around vitest 1.5.0. IMO it should either error, or "disable" concurrency (e.g. set it to 1).

Reproduction

import tsconfigPaths from "vite-tsconfig-paths";
import { defineConfig } from "vitest/config";

export default defineConfig({
  plugins: [tsconfigPaths()],
  server: {
    watch: {
      ignored: [
        "**/node_modules/**",
        "**/dist/**",
        "**/postgres-data/**",
      ],
    },
  },
  test: {
    coverage: {
      provider: "v8",
      reporter: ["json"],
    },
    maxConcurrency: 0,
    pool: "forks",
    poolOptions: {
      forks: {
        singleFork: true,
      },
      threads: {
        singleThread: true,
      },
    },
    fileParallelism: false,
    globals: true,
    setupFiles: ["./src/test/setup-test-env.ts"],
    include: ["./src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"],
    restoreMocks: true,
  },
});

System Info

System:
    OS: Linux 5.15 Ubuntu 22.04.1 LTS 22.04.1 LTS (Jammy Jellyfish)
    CPU: (24) x64 12th Gen Intel(R) Core(TM) i9-12900KF
    Memory: 27.98 GB / 31.27 GB
    Container: Yes
    Shell: 5.8.1 - /usr/bin/zsh
  Binaries:
    Node: 20.12.1 - ~/.volta/tools/image/node/20.12.1/bin/node
    Yarn: 3.3.0 - ~/.volta/tools/image/yarn/3.3.0/bin/yarn
    npm: 10.5.0 - ~/.volta/tools/image/node/20.12.1/bin/npm
    pnpm: 9.7.0 - ~/.local/share/pnpm/pnp

Used Package Manager

pnpm

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    p3-minor-bugAn edge case that only affects very specific usage (priority)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions