From 6c6fba9a14fff1837077ca1948fd6a09110c1c9e Mon Sep 17 00:00:00 2001 From: Jason Wen Date: Sun, 23 Aug 2026 02:57:02 -0400 Subject: [PATCH] ci: fix flaky LLK test (#1940) --- .../selfdrive/locationd/tests/test_locationd.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/openpilot/sunnypilot/selfdrive/locationd/tests/test_locationd.py b/openpilot/sunnypilot/selfdrive/locationd/tests/test_locationd.py index ac6ab6aaea..2e99122bc7 100644 --- a/openpilot/sunnypilot/selfdrive/locationd/tests/test_locationd.py +++ b/openpilot/sunnypilot/selfdrive/locationd/tests/test_locationd.py @@ -83,9 +83,14 @@ class TestLocationdProc(OpenpilotTestCase): self.pm.send(msg.which(), msg) if msg.which() == "cameraOdometry": self.pm.wait_for_readers_to_update(msg.which(), timeout=1, dt=0.005) - time.sleep(1) # wait for async params write + for _ in range(50): + val = self.params.get('LastGPSPositionLLK') + if val is not None: + break + time.sleep(0.1) - lastGPS = json.loads(self.params.get('LastGPSPositionLLK')) + self.assertIsNotNone(val, "LastGPSPositionLLK not written within 5s") + lastGPS = json.loads(val) self.assertAlmostEqual(lastGPS['latitude'], self.lat, delta=0.001) self.assertAlmostEqual(lastGPS['longitude'], self.lon, delta=0.001) self.assertAlmostEqual(lastGPS['altitude'], self.alt, delta=0.001)