Tools: autotest: make drain_mav truly drain the mavlink connection

This commit is contained in:
Peter Barker 2019-03-11 21:34:07 +11:00 committed by Peter Barker
parent 281dbfcef8
commit f71f100d6a

View File

@ -282,8 +282,7 @@ class AutoTest(ABC):
pass
# empty mav to avoid getting old timestamps:
while self.mav.recv_match(blocking=False):
pass
self.drain_mav()
self.initialise_after_reboot_sitl()
@ -395,7 +394,7 @@ class AutoTest(ABC):
def drain_mav(self):
count = 0
tstart = time.time()
while self.mav.recv_match(type='SYSTEM_TIME', blocking=False) is not None:
while self.mav.recv_match(blocking=False) is not None:
count += 1
tdelta = time.time() - tstart
if tdelta == 0: