Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vitest 3.0.6 and 3.0.7 hangs up if an entry in exclude option starts with / #7598

Open
6 tasks done
exoego opened this issue Mar 2, 2025 · 5 comments
Open
6 tasks done
Labels
p3-minor-bug An edge case that only affects very specific usage (priority) upstream

Comments

@exoego
Copy link

exoego commented Mar 2, 2025

Describe the bug

My vitest.config.ts had /__fixtures__/ in exclude option.
https://github.com/exoego/esbuild-bundle-analyzer/pull/124/files#diff-2ee894bf23aa44ff4ce12a3da8af19ab20180474ebf2176dbe5f2eea3f96dc92L15

It worked until Vitest 3.0.5.
But on Vitest 3.0.6 and 3.0.7, test process hangs up forever.

This hang-up is also observed in GitHub Action and job gets canceled after 5 minutes.
Image

After some tries, it appears that an entry in exclude option staring with / causes this issue.

    exclude: [
      // These work finely
      // '**/__fixtures__/**',
      // '__fixtures__/**',

      // But this doesn't work: it hangs up
      '/__fixtures__/**',
    ]

Reproduction

  1. git clone https://github.com/exoego/vitest-hung-repro
  2. cd vitest-hung-repro
  3. npm i
  4. npm run test

System Info

System:
    OS: macOS 14.7.3
    CPU: (10) arm64 Apple M1 Pro
    Memory: 242.66 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.4.0 - ~/.asdf/installs/nodejs/22.4.0/bin/node
    npm: 10.8.1 - ~/.asdf/installs/nodejs/22.4.0/bin/npm
  Browsers:
    Chrome: 133.0.6943.142
    Safari: 18.2
  npmPackages:
    vitest: ^3.0.4 => 3.0.7

Used Package Manager

npm

Validations

@AriPerkkio
Copy link
Member

Maybe side-effect of #7504 🤔

@hi-ogawa
Copy link
Contributor

hi-ogawa commented Mar 3, 2025

It looks like a tinyglobby issue. I reported it there SuperchupuDev/tinyglobby#99.

@hi-ogawa
Copy link
Contributor

hi-ogawa commented Mar 3, 2025

@exoego Btw, I don't think /__fixtures__/** was functioning as filter even on previous versions. Can you confirm?

@hi-ogawa hi-ogawa added upstream p3-minor-bug An edge case that only affects very specific usage (priority) and removed pending triage labels Mar 3, 2025
@exoego
Copy link
Author

exoego commented Mar 3, 2025

Correct, /__fixtures__/ seems not working as file patterns, as far as I tested. My bad.
I expected it is treated as relative path from the repo root, but it is not.

My expectation as user is:

  1. Don't hang up. Because it is not easy to understand what was a cause without error message.
  2. (good to have) Warning if patterns are meaningless or broken

@yanai101
Copy link

yanai101 commented Mar 3, 2025

Same here!!!
V 3.0.5 work fine but 3.0.6/7 stacking the terminal (I'm with - m3 mac pro)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p3-minor-bug An edge case that only affects very specific usage (priority) upstream
Projects
None yet
Development

No branches or pull requests

4 participants