From 9117a414bb274cf33e9baeae77b8ffdf45638b40 Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Fri, 1 Aug 2025 15:20:50 -0700 Subject: [PATCH] process replay clean up (#35878) * format * containers might not be set * opts * halves startup time for 12 procs (1.6 to 0.8s) * stash * Revert "stash" This reverts commit 3e119a9602e495bd5a57b94e73fa53d4f45051b1. * Revert "halves startup time for 12 procs (1.6 to 0.8s)" This reverts commit a39edf0a579f0c861ccb904a2718254fe32e03d0. * Revert "opts" This reverts commit 4dc1f75f0909a93650f8f7e8525af3e4eae08205. * already set! --- selfdrive/test/process_replay/process_replay.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/selfdrive/test/process_replay/process_replay.py b/selfdrive/test/process_replay/process_replay.py index ac5e94864c..0d35f8a910 100755 --- a/selfdrive/test/process_replay/process_replay.py +++ b/selfdrive/test/process_replay/process_replay.py @@ -34,6 +34,7 @@ NUMPY_TOLERANCE = 1e-7 PROC_REPLAY_DIR = os.path.dirname(os.path.abspath(__file__)) FAKEDATA = os.path.join(PROC_REPLAY_DIR, "fakedata/") + class DummySocket: def __init__(self): self.data: list[bytes] = [] @@ -47,6 +48,7 @@ class DummySocket: def send(self, data: bytes): self.data.append(data) + class LauncherWithCapture: def __init__(self, capture: ProcessOutputCapture, launcher: Callable): self.capture = capture @@ -64,7 +66,7 @@ class ReplayContext: self.main_pub = cfg.main_pub self.main_pub_drained = cfg.main_pub_drained self.unlocked_pubs = cfg.unlocked_pubs - assert(len(self.pubs) != 0 or self.main_pub is not None) + assert len(self.pubs) != 0 or self.main_pub is not None def __enter__(self): self.open_context() @@ -372,7 +374,7 @@ def get_car_params_callback(rc, pm, msgs, fingerprint): with car.CarParams.from_bytes(cached_params_raw) as _cached_params: cached_params = _cached_params - CP = get_car(*can_callbacks, lambda obd: None, Params().get_bool("AlphaLongitudinalEnabled"), False, cached_params=cached_params).CP + CP = get_car(*can_callbacks, lambda obd: None, params.get_bool("AlphaLongitudinalEnabled"), False, cached_params=cached_params).CP params.put("CarParams", CP.to_bytes()) @@ -712,8 +714,8 @@ def _replay_multi_process( all_msgs = sorted(lr, key=lambda msg: msg.logMonoTime) log_msgs = [] + containers = [] try: - containers = [] for cfg in cfgs: container = ProcessContainer(cfg) containers.append(container)