IQ.Pilot Release Commit @ 4b0cfbe
This commit is contained in:
@@ -221,7 +221,6 @@ class BundleProcess(NativeProcess):
|
||||
def __init__(self, name, bundle, entry, should_run, enabled=True, sigkill=False, restart_if_crash=False):
|
||||
self.bundle = bundle
|
||||
self.entry = entry
|
||||
self.restart_if_crash = restart_if_crash
|
||||
runner_path = preferred_runner_path()
|
||||
runner_cmd = str(runner_path) if runner_path.is_absolute() else "./iqpilot_bundle_runner"
|
||||
runner_cwd = ".iqpilot/runtime_root" if runner_path.is_absolute() else "system/proprietary_runtime"
|
||||
@@ -238,6 +237,7 @@ class BundleProcess(NativeProcess):
|
||||
should_run=should_run,
|
||||
enabled=enabled,
|
||||
sigkill=sigkill,
|
||||
restart_if_crash=restart_if_crash,
|
||||
)
|
||||
|
||||
def start(self) -> None:
|
||||
|
||||
@@ -68,7 +68,7 @@ def always_run(started: bool, params: Params, CP: car.CarParams) -> bool:
|
||||
return True
|
||||
|
||||
def nav_assist(started: bool, params: Params, CP: car.CarParams) -> bool:
|
||||
return params.get_bool("IQAndroidNav")
|
||||
return params.get_bool("IQNavAssistDev") and params.get_bool("IQAndroidNav")
|
||||
|
||||
def only_onroad(started: bool, params: Params, CP: car.CarParams) -> bool:
|
||||
return started
|
||||
|
||||
@@ -67,6 +67,11 @@ class TestManager:
|
||||
assert manager.update_modeld_watchdog(deadline, True, False, proc, 16.0) is None
|
||||
proc.restart.assert_not_called()
|
||||
|
||||
def test_bundle_process_keeps_restart_if_crash(self):
|
||||
proc = BundleProcess("test", "bundle", "entry", lambda *_: True, restart_if_crash=True)
|
||||
assert proc.restart_if_crash is True
|
||||
assert BundleProcess("test", "bundle", "entry", lambda *_: True).restart_if_crash is False
|
||||
|
||||
def test_bundle_process_stops_with_sigterm(self, mocker):
|
||||
proc = BundleProcess("test", "bundle", "entry", lambda *_: True)
|
||||
proc.proc = mocker.Mock(exitcode=None, pid=123)
|
||||
|
||||
Reference in New Issue
Block a user