Skip to content

Conversation

@penalosa
Copy link
Contributor

Fixes #11022.

When using isolatedStorage: true without singleWorker, running a subset of tests first (e.g., via VSCode or with a file filter) and then running all tests would crash with an assertion error:

assert(fileMf !== undefined)

This was because Miniflare instances were only created for test files discovered during the initial run. When running all tests afterwards, new test files would not have corresponding Miniflare instances in the Map.

This fix modifies getProjectMiniflare() to check for newly discovered test files when reusing isolated Miniflare instances, creating new instances as needed.


  • Tests
    • Tests included/updated
    • Automated tests not possible - manual testing has been completed as follows:
    • Additional testing not necessary because: This is a race condition bug that's difficult to test automatically - the fix adds defensive handling for newly discovered test files
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: Bug fix only, no new features or API changes

@changeset-bot
Copy link

changeset-bot bot commented Jan 29, 2026

🦋 Changeset detected

Latest commit: 5fa9584

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@claude
Copy link
Contributor

claude bot commented Jan 29, 2026

Claude finished @penalosa's task —— View job


Changeset Review

Reviewing changeset files...

  • Read changeset guidelines
  • Review changeset file
  • Validate against criteria
  • Check for images

All changesets look good

The changeset .changeset/fix-vitest-pool-rerun.md follows all the guidelines:

  1. Version Type: Correctly marked as patch (bug fix)
  2. Changelog Quality: Clear, descriptive title and detailed explanation of the bug, when it occurs, and what was fixed
  3. Markdown Headers: No h1/h2/h3 headers used
  4. Analytics: Not applicable (no analytics changes)
  5. Dependabot: Not applicable (not a dependency update)
  6. Experimental Features: Not applicable (bug fix to existing functionality)

The changeset description is well-written with:

  • A clear imperative title describing the fix
  • Good context explaining the specific scenario that caused the crash
  • Technical details about the root cause and solution

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 29, 2026

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@12283

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@12283

miniflare

npm i https://pkg.pr.new/miniflare@12283

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@12283

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@12283

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@12283

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@12283

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@12283

@cloudflare/workers-utils

npm i https://pkg.pr.new/@cloudflare/workers-utils@12283

wrangler

npm i https://pkg.pr.new/wrangler@12283

commit: 5fa9584

@penalosa penalosa closed this Jan 29, 2026
@github-project-automation github-project-automation bot moved this from Untriaged to Done in workers-sdk Jan 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

test setup crashes when running all tests having started by running a subset of tests

1 participant