test loggerd: limit samples to number of services

old-commit-hash: 6e26403cee2d2d46b5eda922413db856fc6e8219
This commit is contained in:
Willem Melching
2021-02-23 16:45:08 +01:00
parent f121e56fcf
commit c1606b60fd

View File

@@ -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)