pull/34975/head
Kacper Rączy 3 weeks ago
parent 6581b6b5ad
commit 53f8579f13
  1. 5
      selfdrive/locationd/test/test_lagd.py

@ -96,6 +96,7 @@ class TestLagd:
estimator = LateralLagEstimator(mocked_CP, 0.05) estimator = LateralLagEstimator(mocked_CP, 0.05)
ds = [] ds = []
test_start = time.perf_counter()
for _ in range(1000): for _ in range(1000):
st = time.perf_counter() st = time.perf_counter()
estimator.update_points() estimator.update_points()
@ -103,4 +104,8 @@ class TestLagd:
d = time.perf_counter() - st d = time.perf_counter() - st
ds.append(d) ds.append(d)
# limit the test to 20 seconds
if time.perf_counter() - test_start > 20.0:
break
assert np.mean(ds) < 0.05 assert np.mean(ds) < 0.05

Loading…
Cancel
Save