Skip to main content

Crate pacta_conformance

Crate pacta_conformance 

Source
Expand description

A backend-agnostic conformance suite for Registry implementations.

The suite is generic over Registry and takes a constructor closure that returns a seeded backend, so it defines no seeding trait: a backend runs the suite from its own #[cfg(test)] module and keeps pacta-conformance a pure dev-dependency. Time is driven entirely through the trait by passing controlled Timestamp values, never a wall clock.

Constants§

CONTENTION_ROUNDS
The number of rounds the contention checks repeat to surface a racing interleaving. This is a probabilistic stress, not a deterministic proof: an atomic backend passes every round, and a non-atomic one is overwhelmingly likely — but not guaranteed on any single round — to be caught here. The harness’s teeth are proven deterministically by the barrier-synchronized broken fixture in this crate’s tests, not by this repetition count.
LEASE_MILLIS
The lease duration, in milliseconds, the suite constructs every backend with.

Functions§

run
Run the full conformance suite against a backend built by make.
run_contention
Verify a sync Registry backend upholds at-most-once authority under real concurrency: two workers contending a settlement on one claimed pact settle it at most once, and two workers contending a claim on one available pact issue at most one claim. Both are asserted through the public trait only — never by inspecting the backend’s lock, transaction, or compare-and-set mechanism — so the check holds for any concurrency-control strategy. Concurrency is real OS threads; a failing assertion panics, failing the calling test.