Skip to content

[Feature] Public persistence testkit: journal/snapshot conformance suite + failure injection #536

Description

@pathosDev

Use case

The repo has a thorough internal cross-backend contract suite for journals/snapshot stores, but it is not exported — users who implement a custom backend (the plugin registry explicitly supports this) have no way to prove conformance, and no failure-injection tools to test their actors against journal errors. Pekko invests exactly here (persistence testkit read journal, JournalPersistFailed / JournalPersistRejected signals) because it is what makes third-party backends viable.

Proposed approach

Export from actor-ts/testkit:

  • verifyJournalContract(() => new MyJournal(options)) — the parameterized conformance suite (ordering, sequence numbers, tags, deletes, concurrency).
  • The same for snapshot stores and durable-state stores.
  • A FailureInjectingJournal decorator: scripted failures (persist rejected, persist failed, read timeout, partial batch) to test actor recovery behavior.

Acceptance criteria

  • Contract suites exported and documented (EN+DE) with a "write your own backend" guide
  • The in-repo backends run through the exported suite (single source of truth, no drift)
  • Failure-injection decorator with deterministic scripting via the testkit scheduler

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestpriority: mediumUseful, not urgentproduction-goalBlocks or defines the path to production readiness

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions