From 9312c772f19ad2e4a7e332ed4dacc801aff266e3 Mon Sep 17 00:00:00 2001 From: Thomas Debrunner Date: Thu, 18 Nov 2021 15:37:54 +0100 Subject: [PATCH] mavsdk-tests: Re-try to launch a mission for some time before failing. This mitigates an issue where the flight controller has an uploaded mission, but has not finished the mission feasibility checks yet. --- test/mavsdk_tests/autopilot_tester.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/mavsdk_tests/autopilot_tester.cpp b/test/mavsdk_tests/autopilot_tester.cpp index 8ec38394b6..8db1fe0180 100644 --- a/test/mavsdk_tests/autopilot_tester.cpp +++ b/test/mavsdk_tests/autopilot_tester.cpp @@ -236,7 +236,9 @@ void AutopilotTester::execute_mission() std::promise prom; auto fut = prom.get_future(); - REQUIRE(_mission->start_mission() == Mission::Result::Success); + + REQUIRE(poll_condition_with_timeout( + [this]() { return _mission->start_mission() == Mission::Result::Success; }, std::chrono::seconds(3))); // TODO: Adapt time limit based on mission size, flight speed, sim speed factor, etc.