Skip to content

fix: detect mock factory cycles that form later - #11642

Merged
sheremet-va merged 1 commit into
mainfrom
fix/mock-factory-late-waiter
Oct 20, 2026
Merged

sheremet-va merged 1 commit into
mainfrom
fix/mock-factory-late-waiter

Conversation

@sheremet-va

Copy link
Copy Markdown
Member

Follow-up to #11623.

A factory that imports a module which waits for the same factory gets the partial exports of that module. This check only ran when the import started. If the module was already evaluating but started to wait for the factory later (for example, a slow import before it), the factory and the module waited for each other until the test timed out.

The factory now also gets the partial exports when the module starts to wait while the factory waits for it.

This made concurrent imports of an automocked module and factory gets partial exports of a module that waits for the mock flaky on CI (for example in #11637). The new test cases fail every time without the fix.

@netlify

netlify Bot commented Oct 19, 2026

Copy link
Copy Markdown

✅ Deploy Preview for vitest-dev ready!

Name Link
🔨 Latest commit 0136d66
🔍 Latest deploy log https://app.netlify.com/projects/vitest-dev/deploys/6ad5da0f5a6fb74af665693e
😎 Deploy Preview https://deploy-preview-11642--vitest-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

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

@sheremet-va
sheremet-va merged commit e955415 into main Oct 20, 2026
31 checks passed
@sheremet-va
sheremet-va deleted the fix/mock-factory-late-waiter branch October 20, 2026 07:47
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 4, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant