This is an automated email from the ASF dual-hosted git repository. xiaoxiang pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git
commit 0faaed99a501bf6ba2cf54a339fd13ea48167def Author: ouyangxiangzhen <[email protected]> AuthorDate: Tue Apr 22 16:14:10 2025 +0800 testing/drivertest: Fix timing issues on QEMU and sims. Since sim and qemu are not cycle accurate simulators, if the vCPU thread is preempted by other high priority tasks, it may cause timing issues. This is easy to happen when the test machine is busy. This commit modifies the condition of timing error and prints out the latency as a warning. Signed-off-by: ouyangxiangzhen <[email protected]> --- testing/drivers/drivertest/drivertest_posix_timer.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/testing/drivers/drivertest/drivertest_posix_timer.c b/testing/drivers/drivertest/drivertest_posix_timer.c index 00b7fb203..d2855dfb4 100644 --- a/testing/drivers/drivertest/drivertest_posix_timer.c +++ b/testing/drivers/drivertest/drivertest_posix_timer.c @@ -41,7 +41,7 @@ * Pre-processor Definitions ****************************************************************************/ -#define RTC_DEFAULT_DEVIATION 10 +#define RTC_DEFAULT_DEVIATION 100 #define DEFAULT_TIME_OUT 2 #define SLEEPSECONDS 10 @@ -159,6 +159,8 @@ static void posix_timer_callback(union sigval arg) (FAR struct posix_timer_state_s *)arg.sival_ptr; int range = get_timestamp() - (*sigev_para).tim; + syslog(0, "range: %d ms\n", range); + assert_in_range(range, sigev_para->it.it_interval.tv_sec * 1000 - sigev_para->deviation, sigev_para->it.it_interval.tv_sec * 1000 + sigev_para->deviation);
