Skip to main content

assert_lifecycle_store_conformance

Function assert_lifecycle_store_conformance 

Source
pub async fn assert_lifecycle_store_conformance(
    store: &dyn LifecycleStore,
    present: &AgentId,
    absent: &AgentId,
)
Expand description

Assert that a LifecycleStore implementation honors the trait contract.

Drives store through &dyn LifecycleStore and checks:

  • register then heartbeat succeeds for a registered agent
  • heartbeat on an unregistered agent returns StorageError::NotFound
  • deregister removes the registration, after which heartbeat returns StorageError::NotFound
  • deregister is idempotent for both registered and absent agents

present is registered and deregistered by the harness; absent must be an agent the store never holds. Panics on the first violated invariant.