feat(worker): supervise VPN connections and recover batched telemetry

This commit is contained in:
DCCONSTRUCTIONS
2026-11-10 01:10:37 +03:00
parent fe5900ff3b
commit ad5a929e06
46 changed files with 2996 additions and 640 deletions
+11
View File
@@ -36,6 +36,17 @@ def _endpoint(router: APIRouter, path: str, method: str) -> Callable[..., Any]:
raise AssertionError(f"{method} {path} route is missing")
def test_pipeline_only_snapshot_does_not_claim_host_metrics_or_zero_network(tmp_path):
service = WorkerTelemetryService(WorkerProfileStore(tmp_path))
probe = _probe()
probe["raw"] = {"node_id": EXPECTED_NODE_ID, "observed_at_utc": "2026-07-27T12:00:00Z"}
snapshot = service._telemetry_document(service.store.read(), probe, 1.0)
assert snapshot["connection"]["reachable"] is True
assert snapshot["connection"]["error_code"] == "telemetry-host-incomplete"
assert snapshot["network"]["aggregate"] is None
assert snapshot["node"]["memory"]["used_percent"] is None
def _probe(
*,
node_id: str = EXPECTED_NODE_ID,