Skip to content

Commit eb50e28

Browse files
peterbarkerclaude
andcommitted
autotest: run external AHRS tests at reduced speedup
The external AHRS drivers parse their serial stream on a real-time thread. At ArduPlane's default autotest speedup (100x) that thread cannot keep the simulated GPS within its health window on a loaded CI runner: a given wall-clock scheduling stall maps to 100x as much sim-time, pushing the GPS frame delta past the is_healthy() thresholds. This produced intermittent "GPS 1: not healthy" arm failures in InertialLabsEAHRS (and is a latent risk for the other EAHRS tests that share fly_external_AHRS). Lower the speedup to 20x for the duration of fly_external_AHRS so the parse thread keeps the GPS healthy. Use context_set_speedup() inside a context_push()/context_pop() pair so the SIM_SPEEDUP parameter and the self.speedup timeout scaler stay in sync and are restored together, even if the test raises. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 7cd2375 commit eb50e28

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

Tools/autotest/arduplane.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3106,6 +3106,13 @@ def fly_generic_mission(self, filename, mission_timeout=60.0, strict=True,
31063106
def fly_external_AHRS(self, sim, eahrs_type,
31073107
dist_to_final_wp_threshold_m: float | None = None):
31083108
"""Fly with external AHRS"""
3109+
# The external AHRS drivers parse their serial stream on a
3110+
# real-time thread. At the default plane speedup (100x) that
3111+
# thread cannot keep the simulated GPS within its health window
3112+
# on a loaded CI runner, producing intermittent "GPS 1: not
3113+
# healthy" arm failures. Run these tests at a reduced speedup so
3114+
# the thread keeps up.
3115+
self.context_set_speedup(20)
31093116
self.customise_SITL_commandline(["--serial4=sim:%s" % sim])
31103117

31113118
self.set_parameters({

0 commit comments

Comments
 (0)