homelab-codex-ws/services/ha-diag-agent/tests
Oskar Kapala c255a021d1 fix(observer): quarantine malformed event files to prevent processing wedge
Was: malformed event (bad JSON / truncated / corrupted bytes) wedged the
node's checkpoint forever — every cycle re-tried, logged, never advanced
past the bad file; all subsequent good events for that node lost.

Now: first parse failure -> atomic os.replace to STATE_DIR/observer_failed_events/<node>/
with collision handling. Checkpoint advances, downstream events flow.
Move failures themselves are logged but don't crash the loop.

Complementary to yesterday's atomic_write_json fix (state files);
this addresses the same race-pattern on event files instead.

Regression test asserts: bad event quarantined to failed_events dir,
removed from hot path, subsequent good event processed (node online),
checkpoint moves to good event.
2026-06-12 11:22:56 +02:00
..
integration feat(ha-diag-agent): WebSocketMonitor for real-time HA liveness 2026-05-29 15:00:18 +02:00
conftest.py feat(ha-diag-agent): three REST diagnostic checks + Phase 3 flag fixes 2026-05-29 14:43:10 +02:00
test_automation_failures.py feat(ha-diag-agent): three REST diagnostic checks + Phase 3 flag fixes 2026-05-29 14:43:10 +02:00
test_event_emitter.py feat(ha-diag-agent): test environment with dual HA Docker instances 2026-05-29 12:56:13 +02:00
test_ha_client.py fix(observer): quarantine malformed event files to prevent processing wedge 2026-06-12 11:22:56 +02:00
test_heartbeat_check.py feat(ha-diag-agent): UnavailableEntitiesCheck with root cause dedup 2026-05-29 13:41:55 +02:00
test_system_health.py feat(ha-diag-agent): three REST diagnostic checks + Phase 3 flag fixes 2026-05-29 14:43:10 +02:00
test_unavailable_entities.py feat(ha-diag-agent): three REST diagnostic checks + Phase 3 flag fixes 2026-05-29 14:43:10 +02:00
test_updates_available.py feat(ha-diag-agent): three REST diagnostic checks + Phase 3 flag fixes 2026-05-29 14:43:10 +02:00
test_websocket_monitor.py feat(ha-diag-agent): WebSocketMonitor for real-time HA liveness 2026-05-29 15:00:18 +02:00