mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-08 17:08:28 -04:00
autotest: disable mavutil autoreconnect in drain_mav
The process may not be available
This commit is contained in:
parent
acd9fb9c0a
commit
271b4d7d3c
@ -2749,7 +2749,17 @@ class AutoTest(ABC):
|
||||
timeout = 120
|
||||
failed_to_drain = False
|
||||
self.pause_SITL()
|
||||
while mav.recv_msg() is not None:
|
||||
# sometimes we recv() when the process is likely to go away..
|
||||
old_autoreconnect = mav.autoreconnect
|
||||
mav.autoreconnect = False
|
||||
while True:
|
||||
try:
|
||||
receive_result = mav.recv_msg()
|
||||
except Exception:
|
||||
mav.autoreconnect = True
|
||||
raise
|
||||
if receive_result is None:
|
||||
break
|
||||
count += 1
|
||||
if time.time() - tstart > timeout:
|
||||
# ArduPilot can produce messages faster than we can
|
||||
@ -2757,6 +2767,7 @@ class AutoTest(ABC):
|
||||
# just die if that seems to be the case:
|
||||
failed_to_drain = True
|
||||
quiet = False
|
||||
mav.autoreconnect = old_autoreconnect
|
||||
self.unpause_SITL()
|
||||
if quiet:
|
||||
self.in_drain_mav = False
|
||||
|
Loading…
Reference in New Issue
Block a user