···99- **Default**: `5`
1010- **CLI**: `--max-concurrency=10`, `--maxConcurrency=10`
11111212-A number of tests that are allowed to run at the same time marked with `test.concurrent`.
1212+The maximum number of tests and hooks that can run at the same time when using `test.concurrent` or `describe.concurrent`.
13131414-Test above this limit will be queued to run when available slot appears.
1414+The hook execution order within a single group is also controlled by [`sequence.hooks`](/config/sequence#sequence-hooks). With `sequence.hooks: 'parallel'`, the execution is bounded by the same limit of [`maxConcurrency`](/config/maxconcurrency).
+1-1
docs/config/sequence.md
···145145146146- `stack` will order "after" hooks in reverse order, "before" hooks will run in the order they were defined
147147- `list` will order all hooks in the order they are defined
148148-- `parallel` will run hooks in a single group in parallel (hooks in parent suites will still run before the current suite's hooks)
148148+- `parallel` runs hooks in a single group in parallel (hooks in parent suites still run before the current suite's hooks). The actual number of simultaneously running hooks is limited by [`maxConcurrency`](/config/maxconcurrency).
149149150150::: tip
151151This option doesn't affect [`onTestFinished`](/api/hooks#ontestfinished). It is always called in reverse order.
+1-1
docs/guide/cli-generated.md
···781781- **CLI:** `--maxConcurrency <number>`
782782- **Config:** [maxConcurrency](/config/maxconcurrency)
783783784784-Maximum number of concurrent tests in a suite (default: `5`)
784784+Maximum number of concurrent tests and suites during test file execution (default: `5`)
785785786786### expect.requireAssertions
787787
+2
docs/guide/parallelism.md
···22222323Vitest supports the [`concurrent`](/api/test#test-concurrent) option to run tests together. If this option is set, Vitest will group concurrent tests in the same _file_ (the number of simultaneously running tests depends on the [`maxConcurrency`](/config/maxconcurrency) option) and run them with [`Promise.all`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/all).
24242525+The hook execution order within a single group is also controlled by [`sequence.hooks`](/config/sequence#sequence-hooks). With `sequence.hooks: 'parallel'`, the execution is bounded by the same limit of [`maxConcurrency`](/config/maxconcurrency).
2626+2527Vitest doesn't perform any smart analysis and doesn't create additional workers to run these tests. This means that the performance of your tests will improve only if you rely heavily on asynchronous operations. For example, these tests will still run one after another even though the `concurrent` option is specified. This is because they are synchronous:
26282729```ts
···77AssertionError: expected 'xx' to be 'yy' // Object.is equality"
88`;
991010-exports[`should fail concurrent-suite-deadlock.test.ts 1`] = `
1111-"Error: Test timed out in 500ms.
1212-Error: Test timed out in 500ms."
1313-`;
1414-1515-exports[`should fail concurrent-test-deadlock.test.ts 1`] = `
1616-"Error: Test timed out in 500ms.
1717-Error: Test timed out in 500ms."
1818-`;
1919-2010exports[`should fail each-timeout.test.ts 1`] = `"Error: Test timed out in 10ms."`;
21112212exports[`should fail empty.test.ts 1`] = `"Error: No test suite found in file <rootDir>/empty.test.ts"`;
+1-1
packages/vitest/src/node/cli/cli-config.ts
···733733 },
734734 },
735735 maxConcurrency: {
736736- description: 'Maximum number of concurrent tests in a suite (default: `5`)',
736736+ description: 'Maximum number of concurrent tests and suites during test file execution (default: `5`)',
737737 argument: '<number>',
738738 },
739739 expect: {