You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A number of tests that are allowed to run at the same time marked with`test.concurrent`.
12
+
The maximum number of tests and hooks that can run at the same time when using`test.concurrent` or `describe.concurrent`.
13
13
14
-
Test above this limit will be queued to run when available slot appears.
14
+
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).
Copy file name to clipboardExpand all lines: docs/config/sequence.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -145,7 +145,7 @@ Changes the order in which hooks are executed.
145
145
146
146
-`stack` will order "after" hooks in reverse order, "before" hooks will run in the order they were defined
147
147
-`list` will order all hooks in the order they are defined
148
-
-`parallel`will run hooks in a single group in parallel (hooks in parent suites will still run before the current suite's hooks)
148
+
-`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).
149
149
150
150
::: tip
151
151
This option doesn't affect [`onTestFinished`](/api/hooks#ontestfinished). It is always called in reverse order.
Copy file name to clipboardExpand all lines: docs/guide/parallelism.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,6 +22,8 @@ Unlike _test files_, Vitest runs _tests_ in sequence. This means that tests insi
22
22
23
23
Vitest 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).
24
24
25
+
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).
26
+
25
27
Vitest 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:
0 commit comments