[rtems-central commit] spec: Fix sporadic test failures

Sebastian Huber sebh at rtems.org
Fri Nov 19 11:56:47 UTC 2021


Module:    rtems-central
Branch:    master
Commit:    47cd9993283d3510d5c1c674cc722f896d7f7df4
Changeset: http://git.rtems.org/rtems-central/commit/?id=47cd9993283d3510d5c1c674cc722f896d7f7df4

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Fri Nov 19 12:52:21 2021 +0100

spec: Fix sporadic test failures

---

 spec/rtems/sem/req/mrsp-obtain.yml | 7 ++-----
 spec/score/sched/req/yield.yml     | 7 ++-----
 2 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/spec/rtems/sem/req/mrsp-obtain.yml b/spec/rtems/sem/req/mrsp-obtain.yml
index e2bb064..f524cd9 100644
--- a/spec/rtems/sem/req/mrsp-obtain.yml
+++ b/spec/rtems/sem/req/mrsp-obtain.yml
@@ -667,11 +667,8 @@ test-support: |
     TQSetScheduler( &ctx->tq_ctx, MOVER, other_scheduler_id, PRIO_VERY_HIGH );
     ctx->tq_ctx.busy_wait[ MOVER ] = true;
     TQSend( &ctx->tq_ctx, MOVER, TQ_EVENT_BUSY_WAIT );
-
-    while ( rtems_scheduler_get_processor() != cpu ) {
-      /* Wait */
-    }
-
+    TQWaitForEventsReceived( &ctx->tq_ctx, MOVER );
+    T_eq_u32( rtems_scheduler_get_processor(), cpu );
     ctx->tq_ctx.busy_wait[ MOVER ] = false;
     TQWaitForExecutionStop( &ctx->tq_ctx, MOVER );
   }
diff --git a/spec/score/sched/req/yield.yml b/spec/score/sched/req/yield.yml
index c057f33..eb1dade 100644
--- a/spec/score/sched/req/yield.yml
+++ b/spec/score/sched/req/yield.yml
@@ -298,11 +298,8 @@ test-support: |
   {
     ctx->tq_ctx.busy_wait[ MOVER ] = true;
     TQSend( &ctx->tq_ctx, MOVER, TQ_EVENT_BUSY_WAIT );
-
-    while ( rtems_scheduler_get_processor() != 1 ) {
-      /* Wait */
-    }
-
+    TQWaitForEventsReceived( &ctx->tq_ctx, MOVER );
+    T_eq_u32( rtems_scheduler_get_processor(), 1 );
     ctx->tq_ctx.busy_wait[ MOVER ] = false;
     TQWaitForExecutionStop( &ctx->tq_ctx, MOVER );
   }



More information about the vc mailing list