From 01945d439fa9931765d39db21443b5f18f7b9266 Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Mon, 19 Feb 2024 13:58:36 -0800 Subject: [PATCH] More startup checks (#31511) * no lag! * kill first --------- Co-authored-by: Comma Device old-commit-hash: 1145122b3fea1ddb8aa49a97688f6b52155bd202 --- selfdrive/manager/process.py | 4 +++- selfdrive/test/test_time_to_onroad.py | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/selfdrive/manager/process.py b/selfdrive/manager/process.py index 523e1fd209..ac1b4ac68c 100644 --- a/selfdrive/manager/process.py +++ b/selfdrive/manager/process.py @@ -281,11 +281,13 @@ def ensure_running(procs: ValuesView[ManagerProcess], started: bool, params=None running = [] for p in procs: if p.enabled and p.name not in not_run and p.should_run(started, params, CP): - p.start() running.append(p) else: p.stop(block=False) p.check_watchdog(started) + for p in running: + p.start() + return running diff --git a/selfdrive/test/test_time_to_onroad.py b/selfdrive/test/test_time_to_onroad.py index a983bdf5fb..a3f803e221 100755 --- a/selfdrive/test/test_time_to_onroad.py +++ b/selfdrive/test/test_time_to_onroad.py @@ -50,6 +50,7 @@ def test_time_to_onroad(): sm.update(100) assert sm.all_alive(), sm.alive assert sm['controlsState'].engageable, f"events: {sm['onroadEvents']}" + assert sm['controlsState'].cumLagMs < 10. finally: proc.terminate() if proc.wait(20) is None: