From 81e8cf414e25650ef1e01b3d45c2440ece0e4923 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20R=C4=85czy?= Date: Fri, 21 Jul 2023 01:03:58 +0200 Subject: [PATCH] process_replay: ability to permanently unlock some sockets (#29070) Add unlocked_pubs for keeping some sockets permanently unlocked --- selfdrive/test/process_replay/process_replay.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/selfdrive/test/process_replay/process_replay.py b/selfdrive/test/process_replay/process_replay.py index 6c49ba3449..72e519d057 100755 --- a/selfdrive/test/process_replay/process_replay.py +++ b/selfdrive/test/process_replay/process_replay.py @@ -39,6 +39,7 @@ class ReplayContext: self.pubs = cfg.pubs 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) def __enter__(self): @@ -55,7 +56,8 @@ class ReplayContext: if self.main_pub is None: self.events = OrderedDict() - for pub in self.pubs: + pubs_with_events = [pub for pub in self.pubs if pub not in self.unlocked_pubs] + for pub in pubs_with_events: self.events[pub] = messaging.fake_event_handle(pub, enable=True) else: self.events = {self.main_pub: messaging.fake_event_handle(self.main_pub, enable=True)} @@ -117,6 +119,7 @@ class ProcessConfig: main_pub_drained: bool = True vision_pubs: List[str] = field(default_factory=list) ignore_alive_pubs: List[str] = field(default_factory=list) + unlocked_pubs: List[str] = field(default_factory=list) class ProcessContainer: