wifi-densepose/v2/crates/wifi-densepose-sensing-server/tests
ruv 5ed8e34510 fix(adr-115/test): state_messages integration test — race on publisher startup
state_messages_published_on_snapshot_broadcast was failing under CI
(0/3 → 2/3 passes; only this one red). Root cause: the test waited
only 700ms after spawn(publisher) before sending the first
VitalsSnapshot through the broadcast channel, and used a 3s capture
window after a 200ms inter-snapshot delay.

What's actually happening on the wire during those 700ms:
  1. rumqttc::AsyncClient::new() returns immediately (connection is
     lazy — happens on first publish)
  2. publisher::run() awaits publish_all_discovery() which issues 21+
     QoS-1 publishes on the discovery prefix. Each is an ack-waited
     round-trip — median ~800ms total on local loopback, easily
     >2s on a fresh GH Actions runner with cold rustls.
  3. After discovery, the run loop reaches its tokio::select! and
     starts draining state_rx.

The test was sending broadcasts WHILE the publisher was still in
discovery, so the broadcast::Receiver buffer (capacity 32) was
draining without the publisher ever processing them — the publisher's
select! only polls state_rx between rumqttc events.

Fix:
  - Wait 3s after spawn() (well past observed ramp-up, doubled for
    CI variance)
  - Send 6 snapshots in a loop with 200ms gaps (one dropped won't
    tank the test)
  - Capture window 8s instead of 3s (room for rate-limited publishes
    to land)

Local impact: test now reliably passes against `mosquitto -c
allow_anonymous=true` on loopback in ~12s wall time. CI matrix should
pick the same green outcome.

Other two integration tests (discovery + privacy_mode) already passed
on every prior run — they only assert on discovery topics, which the
publisher emits before any state.

Refs PR #778, issue #776.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-05-23 15:33:41 -04:00
..
introspection_latency.rs feat(introspection): I6 — regime-changed signal + per-frame analyze + honest ADR-099 D8 amendment 2026-05-13 23:29:37 -04:00
mqtt_integration.rs fix(adr-115/test): state_messages integration test — race on publisher startup 2026-05-23 15:33:41 -04:00
multi_node_test.rs fix(security): audit — fix RUSTSEC vulns, clippy warnings, dead code (#769) 2026-05-23 05:36:13 -04:00
rvf_container_test.rs fix(security): audit — fix RUSTSEC vulns, clippy warnings, dead code (#769) 2026-05-23 05:36:13 -04:00
vital_signs_test.rs fix(security): audit — fix RUSTSEC vulns, clippy warnings, dead code (#769) 2026-05-23 05:36:13 -04:00