Spectre.Instance.CheckpointStore.Conformance (Spectre v0.3.1)

Copy Markdown View Source

Adapter-neutral conformance checks for an Instance Checkpoint Store.

The runner writes two consecutive canonical checkpoints through Spectre.Instance.CheckpointStore, verifies semantic readback, reconciles an exact retry, proves that a stale writer cannot replace revision two, and races two revision-three writers to require a single CAS winner. It uses the real current checkpoint codec and Instance validator and has no ExUnit dependency.

The Checkpoint Store behaviour deliberately leaves the adapter's conflict vocabulary open. The race therefore accepts any declared error from the losing writer, but rejects {:ambiguous, reason} because that outcome cannot prove there was only one commit.

A run leaves revision three in storage. Callers must pass a fresh, isolated Spectre.Instance.Ref; adapter options belong in the ordinary store config.

Summary

Functions

Compares one checkpoint semantically through two store configurations.

Runs the public CAS contract using a fresh Instance Ref.

Types

report()

@type report() :: %{
  create: :committed,
  update: :committed,
  exact_retry: :accepted | :readback_verified,
  stale_write: :rejected,
  concurrent_cas: :single_winner,
  readback: :verified,
  revision: 3,
  checkpoint_digest: String.t()
}

Functions

read_after_restart(before, after_restart, ref)

Compares one checkpoint semantically through two store configurations.

run(store, ref)

Runs the public CAS contract using a fresh Instance Ref.