Skip to content

autotest: run BatteryFailsafe at default speedup#33765

Merged
peterbarker merged 1 commit into
ArduPilot:masterfrom
peterbarker:pr-claude/batteryfailsafe-full-speedup
Jul 20, 2026
Merged

autotest: run BatteryFailsafe at default speedup#33765
peterbarker merged 1 commit into
ArduPilot:masterfrom
peterbarker:pr-claude/batteryfailsafe-full-speedup

Conversation

@peterbarker

@peterbarker peterbarker commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Summary

Remove pointless speed limiting in battery failsafe testing

Classification & Testing (check all that apply and add your own)

  • Checked by a human programmer
  • Non-functional change
  • No-binary change
  • Infrastructure change (e.g. unit tests, helper scripts)
  • Automated test(s) verify changes (e.g. unit test, autotest)
  • Tested manually, description below (e.g. SITL)
  • Tested on hardware
  • Logs attached
  • Logs available on request

This has been soak-tested in my own fork.

● BatteryFailsafe savings, measured on real CI runners (from the 120-sample soak, not local):

  ┌───────────────────────┬──────────────────────────────────┬─────────────────────────────────────────┬──────────────────────────┐
  │                       │      Before (SIM_SPEEDUP=4)      │         After (default speedup)         │          Saved           │
  ├───────────────────────┼──────────────────────────────────┼─────────────────────────────────────────┼──────────────────────────┤
  │ Unloaded runner       │ 322 s (10-run production median) │ 89.5 s (median of 15, spread 88.7–92.8) │ ~232 s ≈ 3.9 min         │
  ├───────────────────────┼──────────────────────────────────┼─────────────────────────────────────────┼──────────────────────────┤
  │ Under 2 CPU stressers │ —                                │ 105.1 s                                 │ still ~217 s vs baseline │
  └───────────────────────┴──────────────────────────────────┴─────────────────────────────────────────┴──────────────────────────┘

Description

BatteryFailsafe pins SIM_SPEEDUP to 4 for its entire duration, making it the fourth most expensive test in all of CI at ~320 wall-seconds per run. The override has been carried through several refactors with no recorded rationale; the original 2013 test did not set it.

Battery failsafe timing is entirely simulation-time: the voltage comes from SIM_BATT_VOLTAGE and BATT_LOW_TIMER counts simulation seconds, so there is no wall-clock coupling that would require a reduced speedup (unlike the GCS failsafe tests, where the test framework's wall-paced heartbeats justify one). Remove the override so the test runs at the suite default.

BatteryFailsafe pins SIM_SPEEDUP to 4 for its entire duration, making
it the fourth most expensive test in all of CI at ~320 wall-seconds
per run.  The override has been carried through several refactors with
no recorded rationale; the original 2013 test did not set it.

Battery failsafe timing is entirely simulation-time: the voltage comes
from SIM_BATT_VOLTAGE and BATT_LOW_TIMER counts simulation seconds, so
there is no wall-clock coupling that would require a reduced speedup
(unlike the GCS failsafe tests, where the test framework's wall-paced
heartbeats justify one).  Remove the override so the test runs at the
suite default.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@khancyr khancyr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if that has been tested, go for it, the analysis is correct

@peterbarker
peterbarker merged commit 6aa29eb into ArduPilot:master Jul 20, 2026
51 checks passed
@github-project-automation github-project-automation Bot moved this from ReadyForDevCall to Done in Peter's ArduPilot 4.8 Queue Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants