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