        length = random.randint(2, 5)
        os.environ["LOGGERD_SEGMENT_LENGTH"] = str(length)
  
        managed_processes["loggerd"].start()
        time.sleep((num_segs + 1) * length)
        managed_processes["loggerd"].stop()
  
        route_path = str(self._get_latest_log_dir()).rsplit("--", 1)[0]
        for n in range(num_segs):
          p = Path(f"{route_path}--{n}")
 
</s> remove     time.sleep(2)
 </s> add     for s in services:
      while not pm.all_readers_updated(s):
        time.sleep(0.1) </s> remove       time.sleep(0.01)
 </s> add  </s> remove def reset_pandas(f):
  @wraps(f)
  def wrapper(*args, **kwargs):
    for serial in Panda.list():
      p = Panda(serial)
      for i in [0, 1, 2, 3, 0xFFFF]:
        p.can_clear(i)
      p.reset()
      p.close()
    f(*args, **kwargs)
  return wrapper


 </s> add  </s> remove                 stage('tici Build') {
 </s> add                 stage('C3: build') { </s> remove                       ["build", "cd selfdrive/manager && ./build.py"],
 </s> add                       ["build master-ci", "cd $SOURCE_DIR/release && EXTRA_FILES='tools/' ./build_devel.sh"],
                      ["build openpilot", "cd selfdrive/manager && ./build.py"],
                      ["test manager", "python selfdrive/manager/test/test_manager.py"],
      time.sleep(num_segs*length + 1)
        length = random.randint(2, 5)
        os.environ["LOGGERD_SEGMENT_LENGTH"] = str(length)
  
        managed_processes["loggerd"].start()
      time.sleep(num_segs*length + 1)
        managed_processes["loggerd"].stop()
  
        route_path = str(self._get_latest_log_dir()).rsplit("--", 1)[0]
        for n in range(num_segs):
          p = Path(f"{route_path}--{n}")
keep keep keep keep replace keep keep keep keep keep
 faster jenkins (#22973)

Co-authored-by: Comma Device <device@comma.ai> 
selfdrive/loggerd/tests/test_loggerd.py