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

@ -91,12 +91,12 @@ class TestLagd:
assert output.liveDelay.validBlocks == 1 assert output.liveDelay.validBlocks == 1
@pytest.mark.skipif(PC, reason="only on device") @pytest.mark.skipif(PC, reason="only on device")
@pytest.mark.timeout(30)
def test_estimator_performance(self): def test_estimator_performance(self):
mocked_CP = mock.Mock(steerActuatorDelay=0.1) mocked_CP = mock.Mock(steerActuatorDelay=0.1)
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()
@ -104,8 +104,4 @@ 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