Fix vitest watch with durable objects#11771
Conversation
🦋 Changeset detectedLatest commit: 1ee29ce 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 finished @avenceslau's task —— View job Changeset Review✅ All changesets look good The changeset
The changeset provides excellent context about what was broken, why it was broken, and how it was fixed. This will create a useful changelog entry for users experiencing this issue. |
create-cloudflare
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-editor-shared
@cloudflare/workers-utils
wrangler
commit: |
25bec82 to
f4c73fe
Compare
|
Claude finished @petebacondarwin's task —— View job PR Review: Fix vitest watch with durable objectsTodo List:
✅ Excellent Fix!This PR correctly resolves the issue where vitest watch mode would fail on second runs with Key Changes AnalysisMain Fix in The
This is crucial because workerd holds file handles to SQLite database directories, and deleting the directories entirely would invalidate those handles. Specific improvements:
Test CoverageComprehensive test suite in The tests cover all the critical scenarios:
The watch mode tests specifically verify that:
Changeset Review
Code Quality
Security & Performance
Overall AssessmentThis is a high-quality fix that:
Recommendation: ✅ Approve and merge This fix resolves a significant usability issue with vitest watch mode for Durable Objects without introducing any risks or breaking changes. |
f4c73fe to
2a05fa2
Compare
f87b2c2 to
d351ca6
Compare
417563f to
844a04e
Compare
844a04e to
64c6761
Compare
…rsion than the local one has been published to npm
734ce25 to
1ee29ce
Compare
Fixes #9913
Fixes #10506
Running vitest-pool-workers with
vitest --watchwould fail second runs due to SQLITE_CANT_OPEN errors or internal reference errors. This was a bug in one of the functions that handles clean up between testsemptyDir, for DOs specifically we were deleting not only the sqlite files but also the dir itself.This meant that
workerdwould not be able to recreate the DO's sqlite storage and DOs would fail to reboot up.A picture of a cute animal (not mandatory, but encouraged)