Skip to content

Some in-source tests are not detected when isolate: false and maxWorkers: 1 are set #10577

Closed

Description

@koutaro-masaki

Describe the bug

In a project using in-source testing, running tests with both isolate: false and maxWorkers: 1 causes some of the source files containing in-source tests to fail with Error: No test suite found in file .... With only one of isolate: false or maxWorkers: 1 set, all tests are detected correctly.

Which files fail varies from run to run. From what I have observed, once a test file has run, the in-source tests in its dependencies (direct or transitive) are no longer detected.

Reproduction

https://github.com/koutaro-masaki/vitest-insource-repro

System Info

OS: macOS 26.5.1
CPU: (14) arm64 Apple M4 Pro
Memory: 143.63 MB / 48.00 GB
Shell: 5.9 - /bin/zsh

Vitest: 4.1.8 (also reproduced on 5.0.0-beta.4)

Used Package Manager

pnpm

Validations

Activity

  1. sheremet-va commented on Jun 11, 2026

    @sheremet-va
    Member

    Yeah, that would make sense. Collecting tests is a side effect of importing it. Since files are cached, tests are not collected. I think we need to add a t query or something in this case, like we do for browser mode and viteModuleRunner: false.

  2. added
    p3-minor-bugAn edge case that only affects very specific usage (priority)
    and removed on Jun 11, 2026
  3. added 2 commits that reference this issue on Jun 12, 2026
    9e30bef
    143608f
  4. added a commit that references this issue on Jul 14, 2026
    04d63aa
  5. added a commit that references this issue on Jul 29, 2026
    a7bf2b2
  6. locked and limited conversation to collaborators on Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions