mirror of
https://github.com/logos-blockchain/logos-blockchain-testing.git
synced 2026-04-11 21:53:45 +00:00
Queue Example
This example runs a small replicated FIFO queue.
The scenarios enqueue messages, dequeue them again, and check that queue state either converges or drains as expected.
How TF runs this
Each example follows the same pattern:
- TF starts a small deployment of queue nodes
- a workload produces messages, or produces and consumes them
- an expectation checks either that queue state converges or that the queue drains
Scenarios
basic_convergenceproduces messages and checks that queue state converges locallybasic_roundtripproduces and consumes messages locally until the queue drainsbasic_restart_chaosinjects random local node restarts during the runcompose_convergenceandcompose_roundtriprun the same checks in Docker Compose
API
Each node exposes:
POST /queue/enqueueto add a messagePOST /queue/dequeueto remove a messageGET /queue/stateto inspect the current queue stateGET /internal/snapshotto read the local replicated state
Run locally
cargo run -p queue-examples --bin basic_convergence
cargo run -p queue-examples --bin basic_roundtrip
cargo run -p queue-examples --bin basic_restart_chaos
Run with Docker Compose
cargo run -p queue-examples --bin compose_convergence
cargo run -p queue-examples --bin compose_roundtrip
Set QUEUE_IMAGE to override the default compose image tag.