From ada2bb4c42bb58b4ddb2cb12ab54c0c6c69ccebc Mon Sep 17 00:00:00 2001 From: Daniel Agar Date: Wed, 20 Nov 2024 13:19:15 -0500 Subject: [PATCH] uORB_tests: relax latency threshold on non-realtime SITL --- platforms/common/uORB/uORB_tests/uORBTest_UnitTest.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/platforms/common/uORB/uORB_tests/uORBTest_UnitTest.cpp b/platforms/common/uORB/uORB_tests/uORBTest_UnitTest.cpp index b40b60ad4760..035d2f9ac52a 100644 --- a/platforms/common/uORB/uORB_tests/uORBTest_UnitTest.cpp +++ b/platforms/common/uORB/uORB_tests/uORBTest_UnitTest.cpp @@ -146,7 +146,14 @@ int uORBTest::UnitTest::pubsublatency_main() pubsubtest_passed = true; - if (mean > 150.0f) { +#if defined(CONFIG_ARCH_BOARD_PX4_SITL) + // relaxed on SITL (non-realtime) + const float kMaxMeanUs = 1000.f; // 1000 microseconds +#else + const float kMaxMeanUs = 150.f; // 150 microseconds +#endif + + if (mean > kMaxMeanUs) { pubsubtest_res = PX4_ERROR; } else {