Skip to content

Conversation

@AriPerkkio
Copy link
Member

@AriPerkkio AriPerkkio commented Nov 10, 2025

Description

Alternative for #8971.

Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time. If the feature is substantial or introduces breaking changes without a discussion, PR might be closed.
  • Ideally, include a test that fails without this PR but passes with it.
  • Please, don't make changes to pnpm-lock.yaml unless you introduce a new test example.
  • Please check Allow edits by maintainers to make review process faster. Note that this option is not available for repositories that are owned by Github organizations.

Tests

  • Run the tests with pnpm test:ci.

Documentation

  • If you introduce new functionality, document it. You can run documentation with pnpm run docs command.

Changesets

  • Changes in changelog are generated from PR name. Please, make sure that it explains your changes in an understandable manner. Please, prefix changeset messages with feat:, fix:, perf:, docs:, or chore:.

@AriPerkkio AriPerkkio changed the title test: failing bail: 1 race condition test fix(core): prevent starting new run when cancelling Nov 10, 2025
@netlify
Copy link

netlify bot commented Nov 10, 2025

Deploy Preview for vitest-dev ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 5dc88d2
🔍 Latest deploy log https://app.netlify.com/projects/vitest-dev/deploys/691a2155f0ab490008297f97
😎 Deploy Preview https://deploy-preview-8991--vitest-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Comment on lines +29 to +30
// No "Error: [vitest-pool]: Cannot run tasks while pool is cancelling" errors should show up
expect(errors).toHaveLength(0)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sheremet-va
sheremet-va previously approved these changes Nov 10, 2025
Copy link
Member

@sheremet-va sheremet-va left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we merge both solutions? 😄

@AriPerkkio
Copy link
Member Author

Can't we merge both solutions? 😄

I would rather not have this logic on multiple levels. And it would be good to see pool throwing the error when vitest/ctx/core attempts to use it incorrectly.

But feel free to choose one or both.

@nicojs
Copy link
Contributor

nicojs commented Nov 11, 2025

I don't mind as long as it's fixed ☺️. StrykerJS users need it solved 😅

@nicojs
Copy link
Contributor

nicojs commented Nov 16, 2025

Any way we can get this merged?

@AriPerkkio AriPerkkio force-pushed the fix/cancel-race-condition branch from 503d506 to 5dc88d2 Compare November 16, 2025 19:09
@sheremet-va sheremet-va merged commit eb98dd8 into vitest-dev:main Nov 17, 2025
19 of 24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Race condition in new pool implementation when using bail

3 participants