test loggerd: limit samples to number of services

old-commit-hash: 6e26403cee
commatwo_master
Willem Melching 4 years ago
parent f121e56fcf
commit c1606b60fd
  1. 4
      selfdrive/loggerd/tests/test_loggerd.py

@ -163,8 +163,8 @@ class TestLoggerd(unittest.TestCase):
qlog_services = [s for s in CEREAL_SERVICES if service_list[s].decimation is not None]
no_qlog_services = [s for s in CEREAL_SERVICES if service_list[s].decimation is None]
services = random.sample(qlog_services, random.randint(2, 10)) + \
random.sample(no_qlog_services, random.randint(2, 10))
services = random.sample(qlog_services, random.randint(2, min(10, len(qlog_services)))) + \
random.sample(no_qlog_services, random.randint(2, min(10, len(no_qlog_services))))
pm = messaging.PubMaster(services)

Loading…
Cancel
Save