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 a4b43521f40ef60abaaaca393f4a064b91002b22 Author: ouyangxiangzhen <[email protected]> AuthorDate: Thu Jul 10 11:05:42 2025 +0800 testing/drivers: Fix posix timer assertions. On QEMU, if vcpus are preempted by other threads, the deviation of the timer might be very large, causing assertion failure. This commit addressed the problem. Signed-off-by: ouyangxiangzhen <[email protected]> --- testing/drivers/drivertest/drivertest_posix_timer.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/testing/drivers/drivertest/drivertest_posix_timer.c b/testing/drivers/drivertest/drivertest_posix_timer.c index d2855dfb4..0870484cf 100644 --- a/testing/drivers/drivertest/drivertest_posix_timer.c +++ b/testing/drivers/drivertest/drivertest_posix_timer.c @@ -161,9 +161,7 @@ static void posix_timer_callback(union sigval arg) 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); + assert(range >= sigev_para->it.it_interval.tv_sec * 1000); syslog(LOG_DEBUG, "callback trigger!!!\n"); (*sigev_para).tim = get_timestamp();
