Use the native clock fallback for Ford fog previews

This commit is contained in:
firestar5683
2026-11-10 12:52:59 -06:00
parent 31c7f5ad8e
commit 551b781a26
3 changed files with 11 additions and 2 deletions
+1 -1
View File
@@ -5,7 +5,7 @@ MAX_AGE_NS = 1_500_000_000
def boot_time_ns():
return time.clock_gettime_ns(time.CLOCK_BOOTTIME)
return time.clock_gettime_ns(getattr(time, "CLOCK_BOOTTIME", time.CLOCK_MONOTONIC))
def main_bus(cp):
@@ -223,3 +223,12 @@ def test_runtime_snapshot_wires_receive_only_status():
session.adapter.ui_state.started = False
session.snapshot(ShellMode.ONROAD)
assert session.rear_fog.sample.call_args.kwargs == {"active": False}
def test_boot_clock_matches_native_mac_fallback(monkeypatch):
monkeypatch.delattr(rear_fog.time, "CLOCK_BOOTTIME", raising=False)
clock = Mock(return_value=10_000_000_000)
monkeypatch.setattr(rear_fog.time, "clock_gettime_ns", clock)
assert rear_fog.boot_time_ns() == 10_000_000_000
clock.assert_called_once_with(rear_fog.time.CLOCK_MONOTONIC)
+1 -1
View File
@@ -1 +1 @@
{"protected_inventory_sha256": "de797337075c26ae5df34af444587f27cc5ce06022c059568f9c188d7c18bfc0", "schema_version": 1}
{"protected_inventory_sha256": "8217ee78dde766571a47c49219cafb5054495760c10e2d557e8e22bc7bd89528", "schema_version": 1}