data: keep snapshot node ages when the radio clock is off (#1007)

* data: keep snapshot node ages when the radio clock is off

* data: add the snapshot clock unit tests left out of the first commit
This commit is contained in:
Afri authored and GitHub committed 2026-10-08 15:55:12 +02:00
1 parent d11e84862d
commit ddae287ee6
9 files changed
+1327 -21

No files matched your search

+19
View File
@@ -17,7 +17,9 @@ from __future__ import annotations
import importlib
import sys
import time
from pathlib import Path
from types import SimpleNamespace
import pytest
@@ -66,6 +68,23 @@ def permit_tx(monkeypatch):
return config
@pytest.fixture
def host_clock(monkeypatch, host_now):
"""Drive the ingestor host clock by hand, starting at ``host_now``.
``host_now`` is a fixture the requesting test module defines, returning
its start time in whole Unix seconds (the receive-time checks, SPEC
RK1-RK4). The clock stays there until a test moves it.
Returns:
A namespace whose ``now`` attribute :func:`time.time` returns.
"""
clock = SimpleNamespace(now=host_now)
monkeypatch.setattr(time, "time", lambda: float(clock.now))
return clock
@pytest.fixture
def load_config(monkeypatch):
"""Reload :mod:`~data.mesh_ingestor.config` under the given environment.