-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
p3-minor-bugAn edge case that only affects very specific usage (priority)An edge case that only affects very specific usage (priority)
Description
Describe the bug
Original issue report: #4473
The documentation for describe.sequential states that tests should run sequentially inside a sequential suite when Vitest is run with the --sequence.concurrent option enabled, however tests actually run concurrently.
Reproduction
Run the following tests with the --sequence.concurrent option:
import { describe, expect, test } from 'vitest';
const delay = (timeout: number) =>
new Promise((resolve) => setTimeout(resolve, timeout));
let count = 0;
describe.sequential('sequential suite', () => {
test('test 1', async ({ task }) => {
await delay(2000);
expect(task.concurrent).toBeFalsy();
expect(++count).toBe(1);
});
test('test 2', ({ task }) => {
expect(task.concurrent).toBeFalsy();
expect(++count).toBe(2);
});
});The tests pass in Vitest versions 1.0.0 through to 1.6.0, but fail in version 2.0.0 onwards.
https://stackblitz.com/edit/vitest-dev-vitest-yvqmqc?file=package.json,sequential.test.ts
System Info
System:
OS: Linux 6.8 Ubuntu 24.04.1 LTS 24.04.1 LTS (Noble Numbat)
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Memory: 6.34 GB / 31.20 GB
Container: Yes
Shell: 5.2.21 - /bin/bash
Binaries:
Node: 18.20.4 - ~/.nvm/versions/node/v18.20.4/bin/node
Yarn: 1.22.22 - ~/.nvm/versions/node/v18.20.4/bin/yarn
npm: 10.7.0 - ~/.nvm/versions/node/v18.20.4/bin/npm
pnpm: 9.12.0 - ~/.nvm/versions/node/v18.20.4/bin/pnpm
Browsers:
Chrome: 129.0.6668.70
npmPackages:
@vitest/browser: workspace:* => 2.1.2
@vitest/coverage-istanbul: workspace:* => 2.1.2
@vitest/coverage-v8: workspace:* => 2.1.2
@vitest/ui: workspace:* => 2.1.2
vite: ^5.4.0 => 5.4.0
vitest: workspace:* => 2.1.2Used Package Manager
npm
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
p3-minor-bugAn edge case that only affects very specific usage (priority)An edge case that only affects very specific usage (priority)