diff --git a/opendbc/car/tests/test_fw_fingerprint.py b/opendbc/car/tests/test_fw_fingerprint.py index 8e966df5c4..aabdaa4ce6 100644 --- a/opendbc/car/tests/test_fw_fingerprint.py +++ b/opendbc/car/tests/test_fw_fingerprint.py @@ -9,7 +9,7 @@ from opendbc.car.structs import CarParams from opendbc.car.fingerprints import FW_VERSIONS from opendbc.car.fw_versions import ESSENTIAL_ECUS, FW_QUERY_CONFIGS, FUZZY_EXCLUDE_ECUS, VERSIONS, build_fw_dict, \ - match_fw_to_car, get_brand_ecu_matches, get_fw_versions, get_fw_versions_ordered, get_present_ecus + match_fw_to_car, get_brand_ecu_matches, get_fw_versions, get_present_ecus from opendbc.car.vin import get_vin CarFw = CarParams.CarFw @@ -26,7 +26,7 @@ def assertFingerprints(self, candidates, expected): def test_exact_match(self, brand, car_model, ecus, test_non_essential): config = FW_QUERY_CONFIGS[brand] CP = CarParams() - for _ in range(100): + for _ in range(20): fw = [] for ecu, fw_versions in ecus.items(): # Assume non-essential ECUs apply to all cars, so we catch cases where Car A with @@ -316,8 +316,15 @@ def test_get_fw_versions(self, subtests, mocker): def fake_carlog_exception(*args, **kwargs): raise + t = 0 + + def fake_monotonic(): + nonlocal t + t += 0.0001 + return t + mocker.patch("opendbc.car.carlog.exception", fake_carlog_exception) - get_fw_versions_ordered(self.fake_can_recv, self.fake_can_send, lambda obd: None, '0' * 17, set()) + mocker.patch("time.monotonic", fake_monotonic) for brand in FW_QUERY_CONFIGS.keys(): with subtests.test(brand=brand): get_fw_versions(self.fake_can_recv, self.fake_can_send, lambda obd: None, brand)