homelab-codex-ws/services
oskar 992ff7ca7c test(control-plane): isolate _make_observer_simple module-state leak — fixes flaky test_incident_lifecycle
The test_run_once_* cases were flaky/order-dependent. Root cause: observer.observer
derives OBSERVER_STATE_FILE from STATE_DIR at import time. The helper patched
STATE_DIR but never OBSERVER_STATE_FILE, so run_once()/_save_checkpoint() wrote the
checkpoint to the real /opt/homelab/state/observer_checkpoint.json. Those node_checkpoints
(tmp paths tagged with a pytest run number) leaked across tests and across pytest runs;
run_once's `file_path > checkpoint` string compare then skipped/kept events based on
run-number ordering. The helper also never restored the module globals it overwrote.

Replace both ad-hoc helpers with an autouse monkeypatch fixture that redirects every
observer path — including OBSERVER_STATE_FILE — into the per-test tmp_path and reverts
them afterward. Tests no longer touch real disk and are deterministic.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 14:48:03 +02:00
..
agent-system feat(observer): 3-state node liveness (fresh/stale/dead) + transitions + read-time net 2026-06-17 20:07:25 +02:00
brain-watchdog test(brain-watchdog): add pytest suite covering import and check() logic 2026-06-01 20:38:24 +02:00
control-plane test(control-plane): isolate _make_observer_simple module-state leak — fixes flaky test_incident_lifecycle 2026-06-25 14:48:03 +02:00
fleet-prometheus fix(fleet-prometheus): bind listen socket to Tailscale IP, not 0.0.0.0 2026-06-24 18:07:18 +02:00
forgejo Add node capability model 2026-05-11 20:46:50 +02:00
ha-diag-agent docs(ha-diag-agent): replace curl verify commands with docker exec 2026-06-11 19:46:33 +02:00
kb-postgres refactor(kb-postgres): relokacja SOLARIA→PIHA — arm64, mem_limit 1g, tuning pod małą maszynę 2026-06-22 19:59:58 +02:00
mosquitto Implement filesystem-first runtime event system 2026-05-12 13:38:25 +02:00
node-agent fix(node-agent): run as uid 1000 with docker group access 2026-06-03 18:20:31 +02:00
node_exporter Fix pending actions: node_exporter, zigbee2mqtt, chelsty-ha monitoring 2026-05-27 15:10:48 +02:00
npm Add node capability model 2026-05-11 20:46:50 +02:00
ollama Add node capability model 2026-05-11 20:46:50 +02:00
planner-agent fix+debug(planner-agent): use base_url (not api_base) for litellm.acompletion, add print [TEMP] 2026-05-28 13:07:58 +02:00
stability-agent fix(stability-agent): run as uid 1000 with docker group access 2026-06-03 18:20:54 +02:00
vikunja fix(vikunja): align compose with known-good live instance (review fixes) 2026-06-17 15:25:25 +02:00
zigbee2mqtt docs: compress CLAUDE.md + fix zigbee2mqtt coordinator docs 2026-05-29 14:17:23 +02:00
.gitkeep Add infrastructure standards and deployment conventions 2026-05-07 21:16:03 +02:00