Browse Source

autotest: quieten RTL

zr-v5.1
Peter Barker 5 years ago committed by Peter Barker
parent
commit
397e134106
  1. 15
      Tools/autotest/common.py

15
Tools/autotest/common.py

@ -2748,13 +2748,18 @@ class AutoTest(ABC):
self.progress("Waiting for DISARM") self.progress("Waiting for DISARM")
if tstart is None: if tstart is None:
tstart = self.get_sim_time() tstart = self.get_sim_time()
last_print_time = 0
while True: while True:
delta = self.get_sim_time_cached() - tstart now = self.get_sim_time_cached()
delta = now - tstart
if delta > timeout: if delta > timeout:
raise AutoTestTimeoutException("Failed to DISARM within %fs" % raise AutoTestTimeoutException("Failed to DISARM within %fs" %
(timeout,)) (timeout,))
self.wait_heartbeat() if now - last_print_time > 1:
self.progress("Got heartbeat") self.progress("Waiting for disarm (%.2fs so far of allowed %.2f)" % (delta, timeout))
last_print_time = now
self.wait_heartbeat(quiet=True)
# self.progress("Got heartbeat")
if not self.mav.motors_armed(): if not self.mav.motors_armed():
self.progress("DISARMED after %.2f seconds (allowed=%.2f)" % self.progress("DISARMED after %.2f seconds (allowed=%.2f)" %
(delta, timeout)) (delta, timeout))
@ -3894,11 +3899,11 @@ class AutoTest(ABC):
self.total_waiting_to_arm_time += armable_time self.total_waiting_to_arm_time += armable_time
self.waiting_to_arm_count += 1 self.waiting_to_arm_count += 1
def wait_heartbeat(self, drain_mav=True, *args, **x): def wait_heartbeat(self, drain_mav=True, quiet=False, *args, **x):
'''as opposed to mav.wait_heartbeat, raises an exception on timeout. '''as opposed to mav.wait_heartbeat, raises an exception on timeout.
Also, ignores heartbeats not from our target system''' Also, ignores heartbeats not from our target system'''
if drain_mav: if drain_mav:
self.drain_mav() self.drain_mav(quiet=quiet)
orig_timeout = x.get("timeout", 10) orig_timeout = x.get("timeout", 10)
x["timeout"] = 1 x["timeout"] = 1
tstart = time.time() tstart = time.time()

Loading…
Cancel
Save