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> |
||
|---|---|---|
| .. | ||
| agent-system | ||
| brain-watchdog | ||
| control-plane | ||
| fleet-prometheus | ||
| forgejo | ||
| ha-diag-agent | ||
| kb-postgres | ||
| mosquitto | ||
| node-agent | ||
| node_exporter | ||
| npm | ||
| ollama | ||
| planner-agent | ||
| stability-agent | ||
| vikunja | ||
| zigbee2mqtt | ||
| .gitkeep | ||