From ed7aca86181fd597c5362a072954c9c93d5f55c1 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Tue, 7 Nov 2023 15:39:07 +0100 Subject: spec: Improve thread idle bodies test --- spec/score/thread/val/idle-body-no-return.yml | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/spec/score/thread/val/idle-body-no-return.yml b/spec/score/thread/val/idle-body-no-return.yml index 39820640..625743a5 100644 --- a/spec/score/thread/val/idle-body-no-return.yml +++ b/spec/score/thread/val/idle-body-no-return.yml @@ -56,19 +56,30 @@ test-support: | static void CheckIdleBody( Context *ctx, rtems_task_entry entry ) { - rtems_id id; + rtems_id id; + rtems_interval interval; + rtems_status_code sc; ctx->counter = 0; id = CreateTask( "WORK", PRIO_LOW ); StartTask( id, entry, ctx ); - while ( ctx->counter == 0 ) { - rtems_status_code sc; + /* + * With optimization disabled, coverage enabled, SMP enabled and a slow + * target, things may take some time. + */ + interval = 1; + while ( ctx->counter == 0 && interval <= 1024 ) { - sc = rtems_task_wake_after( 1 ); + sc = rtems_task_wake_after( interval ); T_rsc_success( sc ); + + interval *= 2; } + sc = rtems_task_wake_after( interval ); + T_rsc_success( sc ); + T_eq_u32( ctx->counter, 1 ); DeleteTask( id ); } -- cgit v1.2.3