fix: ensure sequential mock/unmock resolution#9830
Merged
sheremet-va merged 10 commits intovitest-dev:mainfrom Mar 24, 2026
Merged
fix: ensure sequential mock/unmock resolution#9830sheremet-va merged 10 commits intovitest-dev:mainfrom
sheremet-va merged 10 commits intovitest-dev:mainfrom
Conversation
Member
|
Could we still have it in parallel if all of them are of the same type? (mock/unmock) I feel like this can hit performance hard otherwise. |
6 tasks
✅ Deploy Preview for vitest-dev ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
Collaborator
Author
|
That optimization should work fine. Just Claude pushed weird code, so don't look that yet 🙃 |
Resolve mock/unmock operations in parallel when all pending operations are of the same type. Fall back to sequential resolution when there's a mix to preserve ordering correctness. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
253625b to
ff15658
Compare
sheremet-va
requested changes
Mar 19, 2026
…lution Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… sequential Group consecutive pending mocks by action type (mock/unmock) and resolve each group in parallel, while running groups sequentially. This avoids unnecessarily serializing all resolutions when a single unmock appears among many mocks. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
sheremet-va
approved these changes
Mar 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Resolves https://discord.com/channels/804011606160703521/1480463846253662218/1480481214170402993
Using
Promise.allfor handlingmockandunmockin parallel can cause race condition when multiplemockandunmockof same modules are involved.The above CI failures is related because it goes through
doUnmockprocessed slower, then module doesn't get mocked and thus module not found.vitest/test/core/test/unmock-import.test.ts
Lines 4 to 27 in 4107f8e
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
pnpm-lock.yamlunless you introduce a new test example.Tests
pnpm test:ci.Documentation
pnpm run docscommand.Changesets
feat:,fix:,perf:,docs:, orchore:.