this test works, but find a better place

pull/28562/head
Shane Smiskol 2 years ago
parent f3769a3496
commit 620e2dedb5
  1. 6
      selfdrive/car/tests/test_fw_fingerprint.py

@ -1,4 +1,5 @@
#!/usr/bin/env python3
import copy
import random
import time
import unittest
@ -16,6 +17,7 @@ CarFw = car.CarParams.CarFw
Ecu = car.CarParams.Ecu
ECU_NAME = {v: k for k, v in Ecu.schema.enumerants.items()}
VERSIONS_COPY = copy.deepcopy(VERSIONS)
class FakeSocket:
@ -216,13 +218,15 @@ class TestFwFingerprintTiming(unittest.TestCase):
avg_time = self._benchmark(brand, num_pandas, 5)
total_time += avg_time
self._assert_timing(avg_time, brand_ref_times[num_pandas][brand], tol)
# self._assert_timing(avg_time, brand_ref_times[num_pandas][brand], tol)
print(f'{brand=}, {num_pandas=}, {len(config.requests)=}, avg FW query time={avg_time} seconds')
with self.subTest(brand='all_brands'):
self._assert_timing(total_time, total_ref_time, tol)
print(f'all brands, total FW query time={total_time} seconds')
self.assertEqual(VERSIONS, VERSIONS_COPY, 'VERSIONS dictionary changed while fingerprinting')
if __name__ == "__main__":
unittest.main()

Loading…
Cancel
Save