From 143f5aec1260d002a3fce8f14f900942d4fc5be9 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Wed, 19 Aug 2026 09:02:16 +1000 Subject: [PATCH] autotest: budget FRSkyPassThroughStatustext in simulated time The test waits for a statustext to reach it over the FRSky passthrough link, and allowed "7 * self.speedup" simulated seconds for it. That scales the wrong way. Measured, with an unlimited budget, the simulated time needed to receive the wanted text is speedup 1 2 5 10 20 100 needs 58.4 53.9 48.7 39.4 39.9 9.9 s allowed 7 14 35 70 140 700 s The requirement falls as the speedup rises, because what has to happen first is that the queue ahead of our text drains, and at a high speedup far less simulated time passes while that happens in wall clock. The budget rose instead, so it handed out 71 times what was needed at the default speedup - no assertion at all - and less than was needed at anything below about 7. It failed every time at --speedup=5, three passes out of three in an overnight sweep, and had only 1.8x margin at --speedup=10. Allow a fixed 150 simulated seconds: 2.6x the slowest measured, and still a real bound at the default speedup. Passes at speedups 1, 5, 10 and 100. Co-Authored-By: Claude Opus 5 (1M context) --- Tools/autotest/vehicle_test_suite.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Tools/autotest/vehicle_test_suite.py b/Tools/autotest/vehicle_test_suite.py index 3f409018263..f996f55a94a 100644 --- a/Tools/autotest/vehicle_test_suite.py +++ b/Tools/autotest/vehicle_test_suite.py @@ -15130,7 +15130,15 @@ switch value''' received_frsky_texts = [] last_len_received_statustexts = 0 - timeout = 7 * self.speedup # it can take a *long* time to get these messages down! + # the queue has to drain before the text we are looking for + # reaches us, and how long that takes is best measured in + # simulated time: 58s at speedup 1, 49s at 5, 39s at 10 and 20, + # 10s at 100 - it falls as the speedup rises. Scaling the budget + # by the speedup therefore had it backwards, handing out 700s + # where 10 was needed and 35s where 49 was, so this failed every + # time at --speedup=5. Allow a fixed 150s, comfortably above the + # slowest measured and still an assertion at the default speedup. + timeout = 150 while True: self.drain_mav() now = self.get_sim_time_cached()