Skip to content

[Durable Objects] Add docs & changelog for eviction helpers in vitest#31686

Draft
apeacock1991 wants to merge 1 commit into
productionfrom
apeacock/do-eviction
Draft

[Durable Objects] Add docs & changelog for eviction helpers in vitest#31686
apeacock1991 wants to merge 1 commit into
productionfrom
apeacock/do-eviction

Conversation

@apeacock1991

@apeacock1991 apeacock1991 commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds docs and changelog for the new vitest helpers, which allow the testing of evictions with Durable Objects.

The implementation PR can be found here: cloudflare/workers-sdk#14398.

Note: I updated two unrelated examples because they actually failed when ran, and all the new examples have been tested and pass.

Documentation checklist

@github-actions github-actions Bot added product:workers Related to Workers product product:durable-objects Durable Objects: https://developers.cloudflare.com/workers/learning/using-durable-objects/ product:changelog size/m labels Jun 25, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:

Pattern Owners
/src/content/changelog/ @cloudflare/pm-changelogs, @cloudflare/product-owners
/src/content/docs/durable-objects/ @elithrar, @rita3ko, @irvinebroque, @vy-ton, @iglesiasbrandon, @joshthoward, @danlapid, @oxyjun, @lambrospetrou, @mikenomitch, @cloudflare/product-owners
/src/content/docs/workers/ @cloudflare/workers-docs, @GregBrimble, @irvinebroque, @mikenomitch, @korinne, @WalshyDev, @cloudflare/deploy-config, @cloudflare/product-owners, @cloudflare/wrangler, @MattieTK, @cloudflare/dev-plat-leads, @vy-ton

@iglesiasbrandon

Copy link
Copy Markdown
Collaborator

/bonk review this pr

@ask-bonk

ask-bonk Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

This is a well-structured PR. The documentation is clear, the examples are practical, and the fixes to existing snippets are appreciated. A few notes:

src/content/docs/durable-objects/examples/testing-with-durable-objects.mdx

  • Good fix changing expect(ids.length).toBe(2) to .toBeGreaterThanOrEqual(2) in the listDurableObjectIds test — that's a realistic failure mode when other tests have created objects.
  • The eviction examples nicely demonstrate the difference between in-memory and durable state. The WebSocket hibernation/close examples are particularly useful.
  • Nit: Consider updating the reviewed: 2023-08-08 frontmatter date since this is a substantial content addition.

src/content/docs/workers/testing/vitest-integration/test-apis.mdx

  • Good job backfilling docs for reset() and abortAllDurableObjects() alongside the new eviction helpers.
  • The DurableObjectEvictionOptions table is clear and concise.
  • The evictDurableObject code example is self-contained and correctly shows the persisted-count behavior.

src/content/changelog/workers/2026-06-25-durable-object-eviction-test-helpers.mdx

  • Clean, to-the-point changelog entry. The inline example covers both single-object eviction and the webSockets option, which is exactly what readers need.

src/content/docs/workers/testing/index.mdx

  • Comparison matrix update is correctly placed.

Overall this looks ready to land. Nice work on testing the examples. 👍

github run

@apeacock1991 apeacock1991 force-pushed the apeacock/do-eviction branch from 70e3470 to 5e43ed1 Compare June 25, 2026 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product:changelog product:durable-objects Durable Objects: https://developers.cloudflare.com/workers/learning/using-durable-objects/ product:workers Related to Workers product size/m

Projects

None yet

Development

Successfully merging this pull request may close these issues.