homelab-codex-ws/services/control-plane/tests
Oskar Kapala 98437d46b2 test(control-plane): atomic write and resilient loader coverage
11 new test cases in test_state_reliability.py covering:
- atomic_write_json: produces valid JSON, no .tmp left behind, overwrites,
  works with nested structures
- _load_actual_state: returns False on empty / truncated file, returns True
  on valid files, preserves last-known-good state across a parse failure
- reconcile: empty/truncated services.json or incidents.json generates zero
  actions (skip-cycle semantics proven end-to-end)
- healthy service with valid world state generates no spurious action

All 32 tests (11 new + 21 existing) pass.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-03 12:27:05 +02:00
..
__init__.py feat(control-plane): route ha-diag-agent events through supervisor 2026-05-29 15:59:23 +02:00
test_state_reliability.py test(control-plane): atomic write and resilient loader coverage 2026-06-03 12:27:05 +02:00
test_supervisor_ha.py feat(control-plane): shadow_mode for HA event auto-actions + deploy docs 2026-05-29 17:12:33 +02:00