From 58b0a1f90d9f0c791e25ca7aa383de9dea2f2a48 Mon Sep 17 00:00:00 2001 From: Ramon Roche Date: Mon, 16 Feb 2026 18:26:01 -0800 Subject: [PATCH] mavsdk_tests: fix wall-clock sleeps in test_multicopter_basics Replace std::this_thread::sleep_for() with tester.sleep_for() to use simulation-aware sleep that accounts for speed factor under lockstep. --- test/mavsdk_tests/test_multicopter_basics.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/mavsdk_tests/test_multicopter_basics.cpp b/test/mavsdk_tests/test_multicopter_basics.cpp index eb00b3bcb1..b7152bc877 100644 --- a/test/mavsdk_tests/test_multicopter_basics.cpp +++ b/test/mavsdk_tests/test_multicopter_basics.cpp @@ -48,7 +48,7 @@ TEST_CASE("Takeoff and hold position", "[multicopter][vtol]") tester.set_takeoff_altitude(takeoff_altitude); tester.store_home(); // The sleep here is necessary for the takeoff altitude to be applied properly - std::this_thread::sleep_for(std::chrono::seconds(1)); + tester.sleep_for(std::chrono::seconds(1)); // Capture altitude before takeoff std::array initial_position = tester.get_current_position_ned(); @@ -63,5 +63,5 @@ TEST_CASE("Takeoff and hold position", "[multicopter][vtol]") // Monitor altitude and fail if it exceeds the tolerance tester.start_checking_altitude(0.15); - std::this_thread::sleep_for(std::chrono::seconds(15)); + tester.sleep_for(std::chrono::seconds(15)); }