Keep operator telemetry live-only with bounded volatile state
This commit is contained in:
@@ -132,7 +132,7 @@ def test_old_lan_binding_is_reconciled_even_when_receiver_healthy(monkeypatch, t
|
||||
|
||||
monkeypatch.setattr(manager, "command", run)
|
||||
assert manager.reconcile(tmp_path) == "ready"
|
||||
assert calls[-1][-3:] == ["broker", "timescale", "normalizer"]
|
||||
assert calls[-1][-2:] == ["broker", "normalizer"]
|
||||
assert "--no-build" in calls[-1] and "--pull" in calls[-1] and "never" in calls[-1]
|
||||
|
||||
|
||||
@@ -144,3 +144,24 @@ def test_failed_compose_reports_waiting_without_ready(monkeypatch, tmp_path):
|
||||
lambda args, timeout: subprocess.CompletedProcess(args, int("up" in args)),
|
||||
)
|
||||
assert manager.reconcile(tmp_path) == "waiting-for-receiver"
|
||||
|
||||
|
||||
def test_readiness_accepts_memory_receiver_and_rejects_retired_database(monkeypatch):
|
||||
import io
|
||||
|
||||
documents = [
|
||||
{"ok": True, "mqtt_connected": True, "database_reachable": True},
|
||||
{
|
||||
"ok": True,
|
||||
"mqtt_connected": True,
|
||||
"storage_ready": True,
|
||||
"storage": {"backend": "memory"},
|
||||
},
|
||||
]
|
||||
monkeypatch.setattr(
|
||||
manager.urllib.request,
|
||||
"urlopen",
|
||||
lambda *args, **kwargs: io.BytesIO(json.dumps(documents.pop(0)).encode()),
|
||||
)
|
||||
assert not manager.receiver_ready()
|
||||
assert manager.receiver_ready()
|
||||
|
||||
Reference in New Issue
Block a user