Files
infix/test/infamy
Joachim Wiberg cf08b577ed test: gps_simple: wait for full position data before has_fix()
has_fix() only checks that fix-mode is set (2d/3d), but altitude and
other fields may not yet be populated in the operational datastore when
gpsd is still processing its first NMEA cycles after boot.  Calling
verify_position() immediately after has_fix() passes can therefore race
and fail with:

  KeyError: 'altitude'

This manifests reliably on the second GPS receiver (gps1) after reboot,
because it is initialized slightly later than gps0 and hits the window
where fix-mode is set but altitude has not yet appeared.

  not ok 11 - Verify gps1 position is near the coordinates
  # Traceback (most recent call last):
  #   File "test/case/hardware/gps_simple/test.py", line 29, in verify_position
  #     alt = float(state["altitude"])
  #                 ~~~~~^^^^^^^^^^^^
  # KeyError: 'altitude'

Add has_position() to infamy/gps.py, which gates on fix-mode AND all
position fields (latitude, longitude, altitude, satellites-used) being
present.  Replace the has_fix() polls in both the pre- and post-reboot
verify steps with has_position().

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2026-03-20 17:05:36 +01:00
..
2025-05-13 16:58:46 +02:00
2025-11-03 15:10:09 +01:00
2025-02-12 10:41:46 +01:00
2024-12-18 14:55:00 +01:00
2024-09-05 07:04:58 +02:00
2025-11-06 13:39:52 +01:00
2024-12-03 16:29:28 +01:00
2026-01-04 12:28:28 +01:00
2025-09-05 16:34:11 +02:00
2026-03-05 08:21:34 +01:00
2024-02-23 14:01:23 +01:00
2026-01-09 11:11:32 +01:00