autotest: reset sitl if forced disarm fails

This commit is contained in:
Peter Barker 2022-09-09 17:33:43 +10:00 committed by Peter Barker
parent 4caaf1533f
commit b06afa8316
1 changed files with 4 additions and 1 deletions

View File

@ -7231,7 +7231,10 @@ Also, ignores heartbeats not from our target system'''
if ex is None: if ex is None:
ex = ArmedAtEndOfTestException("Still armed at end of test") ex = ArmedAtEndOfTestException("Still armed at end of test")
self.progress("Armed at end of test; force-rebooting SITL") self.progress("Armed at end of test; force-rebooting SITL")
self.disarm_vehicle(force=True) try:
self.disarm_vehicle(force=True)
except AutoTestTimeoutException:
reset_needed = True
self.forced_post_test_sitl_reboots += 1 self.forced_post_test_sitl_reboots += 1
if reset_needed: if reset_needed:
self.progress("Force-resetting SITL") self.progress("Force-resetting SITL")