From 53f8579f13a5fb99ed6cc5856fa1f9183a485954 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20R=C4=85czy?= Date: Thu, 3 Apr 2025 20:19:18 -0700 Subject: [PATCH] Time limit --- selfdrive/locationd/test/test_lagd.py | 5 +++++ 1 file changed, 5 insertions(+) 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