From 2aeed32a7210d8c55fba4921f11249c97a0ea87c Mon Sep 17 00:00:00 2001 From: ruv Date: Sat, 23 May 2026 15:44:56 -0400 Subject: [PATCH] fix(adr-115/test): per-test MQTT client_id so session-takeover doesn't break state test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The mqtt-integration test suite still failed `state_messages_published_ on_snapshot_broadcast` after the timing fix (5ed8e3451) — but with a new symptom: 'expected ON state, got []'. The subscriber captured ZERO messages on the presence state topic. Root cause: all three integration tests built `client_id` as `ruview-int-test-` — the same string for every test in the sequential cargo-test run. MQTT brokers default to "session takeover": when a new connect arrives with the same client_id as an existing session, mosquitto disconnects the old one immediately. Sequence on CI (`--test-threads=1`): 1. discovery_topics_appear_on_broker connects (ruview-int-test-1234) 2. test passes; publisher task continues running in background 3. privacy_mode_suppresses_biometric_discovery connects (same id) → mosquitto kicks test 1's publisher mid-rumqttc-disconnect-handshake 4. state_messages_published_on_snapshot_broadcast connects (same id) → mosquitto kicks test 2's publisher → test 3's publisher in turn races with the broker's cleanup and its first publishes may land in a half-cleaned session → state messages dropped silently Fix: include a per-test label in the client_id (`ruview-int-test--