Patinas — Acceptance Testing
This guide defines the Product P0 acceptance checks and how to run them locally and in CI. It focuses on end-to-end continuity/latency under mild loss and QUIC preview stability as defined in ../TODO.md and docs/engineering/ROADMAP.md.
Scope (P0)
- Resilience engine end-to-end acceptance: synthetic pipeline continuity with p95 latency ≤ 450 ms under mild loss.
- QUIC adapter (preview) acceptance: loopback test passes reliably on Linux; QUIC runtime counters and bytes-in-flight gauge are exposed via apps/SDK.
- CI gating acceptance: required checks enabled in GitHub branch protection (fmt, clippy -D warnings, tests, cargo-deny, docs-check, e2e smoke).
- RTSP/ONVIF (pilot) acceptance: RTSP ingest/serve works in the Docker harness; Digest auth works end-to-end when configured.
- No-panics acceptance (pilot apps):
patinas-proxy,patinas-hub,patinas-relay,patinas-nodemust not panic on normal runtime paths. - ONVIF corpus acceptance (pilot): golden corpus tests pass; adding a new camera case is a repeatable, documented workflow.
Payload classes (invariant)
- Encoded frames / access units (
EncodedFramepayloads): engine may be applied. - Muxed container bytes (e.g. Matroska/MKV fragments): engine must not be applied (parity/jitter corrupts byte streams).
Operational note: the proxy’s optional GStreamer MKV synthetic path disables the engine automatically (see docs/architecture/PROXY.md).
Prerequisites
- Linux kernel available (native Linux or Docker Desktop with WSL2 backend).
- Docker and Compose plugin installed; privileged containers allowed (for netem).
- Rust toolchain as pinned by
rust-toolchain.toml. - Ports 9640/9641 free if running proxy/hub locally for metrics checks.
Quick checklist
- Bring up e2e stack and run the mild-loss scenario in execute mode.
- Verify PASS in artifacts; p95 ≤ 450 ms; no continuity gaps.
- Run QUIC loopback tests on Linux; confirm passing.
- Verify presence of QUIC metrics (bytes-in-flight gauge plus QUIC counters) via app tests or metrics endpoints.
- Ensure CI required checks are enabled and green on a test PR.
- (Optional) Run RTSP Docker harness integration tests.
- (Pilot) Confirm no-panic policy for pilot apps (tests + smoke runs).
- (Pilot) Run ONVIF golden corpus tests (SDP + URL parsing).
1) Resilience engine acceptance (mild loss)
Bring up the e2e topology and execute the acceptance scenario. Artifacts (CSV/HTML) are written under out/ by default.
Plan mode (dry-run):
cargo run -p patinas-chaos -- --scenario tests/e2e/mild_loss_accept.yaml --dry-run true
Execute mode (applies tc/netem on Linux; requires Docker with privileged router):
docker compose -f deploy/docker/docker-compose.e2e.yml up -d
cargo run -p patinas-chaos -- --scenario tests/e2e/mild_loss_accept.yaml --execute --dry-run false --i-know-what-im-doing
Acceptance criteria:
- Process exits with code 0.
out/*.htmlsummary shows PASS and includes per-endpoint quantiles.- For the synthetic stream, p95 latency ≤ 450 ms.
- No pipeline continuity gaps (steady frame flow, expected drops/repairs within thresholds).
Notes:
- HTML report and CSV include pre-computed p50/p95/p99 from Prometheus histograms.
- If thresholds are missed, tune FEC/ARQ/jitter parameters, re-run, and record final settings.
2) QUIC adapter acceptance (preview)
Run QUIC loopback tests (Linux-only) and verify metrics exposure.
Loopback (adapter tests):
cargo test -p patinas-adapters-quic --features "quinn-net" -- --nocapture
Metrics presence (app tests):
cargo test -p patinas-hub -p patinas-proxy -- --nocapture
Optional manual metrics check (with apps running locally):
curl -s http://127.0.0.1:9640/metrics | rg "patinas_(bytes_in_flight|quic_connect_ok_total|quic_handshake_failures_total|quic_reconnects_total)"
curl -s http://127.0.0.1:9641/metrics | rg "patinas_(bytes_in_flight|quic_connect_ok_total|quic_handshake_failures_total|quic_reconnects_total)"
Acceptance criteria:
- QUIC loopback tests pass reliably on Linux.
- QUIC counters (
patinas_quic_*) andpatinas_bytes_in_flightgauge are present via apps/SDK.
3) CI gating acceptance
Enable required checks on main via GitHub branch protection:
- cargo fmt, clippy -D warnings, test
- cargo-deny (advisories/licenses)
- docs-check (docs lint/link-check)
- e2e smoke (Linux): runs one scenario and uploads KPI CSV/HTML artifacts
Create a test PR to confirm checks are enforced and passing.
4) RTSP integration acceptance (Docker harness)
Patinas includes RTSP integration tests for the GStreamer RTSP client/server. They are gated behind env vars so local cargo test does not require Docker.
Run (from workspace root patinas/):
docker compose -f tests/e2e/docker-compose.rtsp-test.yml up -d
PATINAS_RTSP_RUN_INTEGRATION=1 cargo test -p patinas-adapters-rtsp -- --nocapture
Acceptance criteria:
- Tests pass in the harness environment.
- When
rtsp.sink.onvif_realm+rtsp.sink.username/passwordare configured, Digest auth works end-to-end (client must authenticate to PLAY).
4b) ONVIF golden corpus acceptance (pilot)
Run the golden corpus tests:
cargo test -p patinas-adapters-rtsp --tests onvif_golden_corpus -- --nocapture
Acceptance criteria:
- Tests pass on CI and locally.
- Adding a new corpus case is repeatable via the documented workflow:
docs/testing/ONVIF_CORPUS.mddocs/tools/ONVIF_SCAN.md(for capture andgrow-corpus)
5) No-panics acceptance (pilot apps)
Acceptance criteria:
cargo test -p patinas-proxy -p patinas-hub -p patinas-relay -p patinas-nodepasses.- Manual smoke runs do not panic under normal conditions (invalid config should fail fast with a clear error, not panic).
Recording results
- Update
TODO.mdby ticking the acceptance items under P0 and moving them to “Done (recent)” once merged. - Capture final tuned parameters and observed p95 in
STATUS.md. - Attach
out/*.htmland*.csvas artifacts in CI or archive them for the release record.
Troubleshooting
- See
docs/testing/TESTING.mdanddocs/testing/E2E_TESTS.mdfor scenario format and runner details. - See
OBSERVABILITY.mdfor metrics dictionary and guidance. - See
patinas/RUNBOOK.mdfor operational debugging steps (metrics, logs, qlog, and common issues).