From 00ebffb0dd9796a6dea0d24b82a0c33159316041 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Beat=20K=C3=BCng?= <beat-kueng@gmx.net>
Date: Tue, 24 Jul 2018 19:36:30 +0200
Subject: [PATCH] uorb tests: run at max priority & increase stack size

- running at max priority significantly decreases jitter for the latency
  test, providing more consistent results
- stack size increase is required for the latency test
---
 src/modules/uORB/uORB_tests/CMakeLists.txt        | 1 +
 src/modules/uORB/uORB_tests/uORBTest_UnitTest.hpp | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/modules/uORB/uORB_tests/CMakeLists.txt b/src/modules/uORB/uORB_tests/CMakeLists.txt
index fc1a76ea4d..eb1083edac 100644
--- a/src/modules/uORB/uORB_tests/CMakeLists.txt
+++ b/src/modules/uORB/uORB_tests/CMakeLists.txt
@@ -44,6 +44,7 @@ px4_add_module(
 	MODULE modules__uORB__uORB_tests
 	MAIN uorb_tests
 	STACK_MAIN 2048
+	PRIORITY "SCHED_PRIORITY_MAX"
 	COMPILE_FLAGS
 	SRCS ${SRCS}
 	DEPENDS
diff --git a/src/modules/uORB/uORB_tests/uORBTest_UnitTest.hpp b/src/modules/uORB/uORB_tests/uORBTest_UnitTest.hpp
index cfbcdb10c0..fdcba194ec 100644
--- a/src/modules/uORB/uORB_tests/uORBTest_UnitTest.hpp
+++ b/src/modules/uORB/uORB_tests/uORBTest_UnitTest.hpp
@@ -146,8 +146,8 @@ int uORBTest::UnitTest::latency_test(orb_id_t T, bool print)
 	// prevent access if the caller data goes out of scope
 	int pubsub_task = px4_task_spawn_cmd("uorb_latency",
 					     SCHED_DEFAULT,
-					     SCHED_PRIORITY_MAX - 5,
-					     1500,
+					     SCHED_PRIORITY_MAX,
+					     1700,
 					     (px4_main_t)&uORBTest::UnitTest::pubsubtest_threadEntry,
 					     args);
 
-- 
GitLab