From 5d4ada8085caa09b49eae7866d9a67264c52f52f Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 9 Oct 2019 16:51:10 +1100 Subject: [PATCH] autotest: fixed MISSION_ITEM_INT receive to be reliable use a condition in recv_match() to ensure we don't mix up msgs from other protocols --- Tools/autotest/apmrover2.py | 3 ++- Tools/autotest/common.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Tools/autotest/apmrover2.py b/Tools/autotest/apmrover2.py index 2dfec015a1..cc220e97ec 100644 --- a/Tools/autotest/apmrover2.py +++ b/Tools/autotest/apmrover2.py @@ -2128,7 +2128,8 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) mission_type) m = mav.recv_match(type='MISSION_ITEM_INT', blocking=True, - timeout=1) + timeout=1, + condition='MISSION_ITEM_INT.mission_type==%u' % mission_type) if m is None: raise NotAchievedException("Did not receive mission item int") if m.mission_type != mission_type: diff --git a/Tools/autotest/common.py b/Tools/autotest/common.py index 8de8640515..2ea27bb637 100644 --- a/Tools/autotest/common.py +++ b/Tools/autotest/common.py @@ -2423,7 +2423,8 @@ class AutoTest(ABC): mission_type) m = self.mav.recv_match(type='MISSION_ITEM_INT', blocking=True, - timeout=5) + timeout=5, + condition='MISSION_ITEM_INT.mission_type==%u' % mission_type) self.progress("Got (%s)" % str(m)) if m is None: raise NotAchievedException("Did not receive MISSION_ITEM_INT")