[AZ-398] Clear remaining test-suite failures + warnings

route_client: route Tier-2 sleep through WallClock.sleep_until_ns
instead of bare time.sleep, fixing the AZ-398 AC-4 components-have-no-
direct-time meta-test failure.

helpers/__init__: lazy-load the heavy descriptor / wgs / image
modules via PEP 562 __getattr__ to fix the cold-start NFR regression
(test_cold_start_under_1000ms_p99 was 1409ms p99; lazy imports drop it
to ~210ms).

pyproject filterwarnings: silence the three upstream SwigPy*
DeprecationWarnings emitted by faiss-cpu / gtsam at import time. They
are an upstream SWIG-binding-layer issue and cannot be fixed from our
code. Suppression is scoped to the three exact messages.

State: batch-3 of cycle-4 closed; cumulative-review marker bumped.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Oleksandr Bezdieniezhnykh
2026-05-26 22:52:04 +03:00
parent 007aa36fbf
commit 4f0d8bdcd9
4 changed files with 184 additions and 124 deletions
@@ -205,7 +205,7 @@ class SatelliteProviderRouteClient:
self._poll_interval_s = float(poll_interval_s)
self._poll_max_attempts = int(poll_max_attempts)
self._injected_client = http_client
self._sleep = sleep if sleep is not None else time.sleep
self._sleep = sleep if sleep is not None else _default_sleep
self._clock_ms = clock_ms if clock_ms is not None else _wall_clock_ms
self._logger = logger or logging.getLogger(
"gps_denied_onboard.components.c11_tile_manager.route_client"
@@ -792,6 +792,21 @@ def _wall_clock_ms() -> int:
return int(time.monotonic() * 1000)
def _default_sleep(seconds: float) -> None:
"""Production sleep hook routes through :class:`WallClock.sleep_until_ns`.
Tests inject a no-op or a recorder via the ``sleep`` constructor
parameter. Routing through ``WallClock`` keeps the AZ-398 AC-4 AST
scan over ``components/`` from seeing a bare ``time.sleep`` — same
pattern used by ``tile_downloader._default_sleep``.
"""
from gps_denied_onboard.clock.wall_clock import WallClock
clock = WallClock()
clock.sleep_until_ns(clock.monotonic_ns() + int(seconds * 1_000_000_000))
def _canonical_json_bytes(body: dict[str, Any]) -> bytes:
"""Stable byte representation for the sha256 audit field.