Keep driving independent of UI restarts

This commit is contained in:
firestar5683
2026-11-01 16:54:44 -06:00
parent 407288852f
commit 36e0e37086
3 changed files with 22 additions and 3 deletions
+1 -1
View File
@@ -260,7 +260,7 @@ class SelfdriveD:
self.events.add(EventName.dashcamMode, static=True)
def update_process_health(self) -> bool:
not_running = driving_process_failures(self.sm['managerState'].processes)
not_running = driving_process_failures(self.sm['managerState'].processes) - {'ui'}
if self.sm.recv_frame['managerState'] and not_running:
if not_running != self.not_running_prev:
cloudlog.event("process_not_running", not_running=not_running, error=True)
@@ -25,7 +25,7 @@ def process_health(processes):
return drive
@pytest.mark.parametrize('name', ['starportd', 'galaxy_hotspot', 'jetlinkd'])
@pytest.mark.parametrize('name', ['starportd', 'galaxy_hotspot', 'jetlinkd', 'ui'])
@pytest.mark.parametrize('running,requested', [(False, False), (False, True), (True, True)])
def test_optional_lifecycle_does_not_block_engagement(name, running, requested):
drive = process_health([(name, running, requested)])
@@ -69,3 +69,22 @@ def test_missing_starport_service_does_not_block_engagement():
state = StateMachine()
state.update(drive.events)
assert state.state == log.SelfdriveState.OpenpilotState.enabled
@pytest.mark.parametrize('critical', ['controlsd', 'selfdrived', 'pandad', 'modeld', 'card', 'camerad', 'soundd', 'unknown_service'])
def test_ui_restart_does_not_hide_driving_failure(critical):
drive = process_health([('ui', False, True), (critical, False, True)])
assert drive.update_process_health()
assert drive.not_running_prev == {critical}
assert drive.events.contains(ET.SOFT_DISABLE)
def test_ui_restart_preserves_enabled_state_without_warning():
drive = process_health([('ui', False, True), ('controlsd', True, True), ('selfdrived', True, True)])
assert not drive.update_process_health()
state = StateMachine()
state.state = log.SelfdriveState.OpenpilotState.enabled
state.update(drive.events)
assert state.state == log.SelfdriveState.OpenpilotState.enabled
assert not drive.events.contains(ET.SOFT_DISABLE)
assert not drive.events.contains(ET.IMMEDIATE_DISABLE)
+1 -1
View File
@@ -1 +1 @@
{"protected_inventory_sha256": "c11fbe2409cae4ba5c1fc311a5715d93588886e26625717f7bc2997a0557d680", "schema_version": 1}
{"protected_inventory_sha256": "76719de784909665231700c43e3485008e4c0e0f8361b273ffac4e9c09d262bd", "schema_version": 1}