Skip to content

Add an eviction-based hibernation wake-restore test (blocked on vitest 4 / vitest-pool-workers >= 0.16.20) #29

Description

@grrowl

ADR-0015 and commit 414beb8 document that the wake-time restore (getWebSockets(SYNC_TAG) in the mixin constructor, mixin.ts:171) has no automated coverage: @cloudflare/vitest-pool-workers gained evictDurableObject/evictAllDurableObjects (graceful evict, storage preserved, WebSockets hibernated not closed) only in 0.16.20, which requires vitest@^4, while the repo pins 0.12.21 / vitest 3.2.4.

Request: bump vitest to 4.x and vitest-pool-workers accordingly, then add a test that (1) opens a sync socket, (2) evicts the DO, (3) performs a server write on the reconstructed instance, and (4) asserts the pre-eviction client still receives the delta — pinning the last code-read-only path in the hibernation story. Long-lived production sockets (hours-idle agent sessions) ride this path constantly.

Related documented gap (ADR-0009:182-188): mid-tick eviction with coalescer-buffered deltas plus a surviving hibernatable socket can silently skip a delta batch (appliedSeq has no contiguity check) — the eviction test rig would also enable pinning that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions