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

Sebastian Huber sebh at rtems.org
Thu Jul 15 08:07:43 UTC 2021


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

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Thu Jul 15 10:06:35 2021 +0200

spec: Fix sporadic test failures

---

 spec/rtems/barrier/req/wait.yml | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/spec/rtems/barrier/req/wait.yml b/spec/rtems/barrier/req/wait.yml
index 1fa9f02..73e8439 100644
--- a/spec/rtems/barrier/req/wait.yml
+++ b/spec/rtems/barrier/req/wait.yml
@@ -67,7 +67,7 @@ pre-conditions:
   states:
   - name: Ticks
     test-code: |
-      ctx->timeout = 2;
+      ctx->timeout = UINT32_MAX;
     text: |
       While the ${../if/release:/params[1]/name} parameter is a clock tick
       interval.
@@ -84,7 +84,9 @@ pre-conditions:
   - name: Never
     test-code: |
       if ( ctx->timeout == RTEMS_NO_TIMEOUT ) {
-        SendEvents( ctx->low_worker_id, EVENT_CHECK_TIMER | EVENT_RELEASE );
+        SendEvents( ctx->low_worker_id, EVENT_TIMER_INACTIVE | EVENT_RELEASE );
+      } else {
+        SendEvents( ctx->low_worker_id, EVENT_TIMER_EXPIRE );
       }
     text: |
       While the calling task waits at the barrier, while the barrier is not
@@ -193,7 +195,7 @@ test-stop: null
 test-support: |
   #define NAME rtems_build_name( 'T', 'E', 'S', 'T' )
 
-  #define EVENT_CHECK_TIMER RTEMS_EVENT_0
+  #define EVENT_TIMER_INACTIVE RTEMS_EVENT_0
 
   #define EVENT_WAIT RTEMS_EVENT_1
 
@@ -201,6 +203,8 @@ test-support: |
 
   #define EVENT_DELETE RTEMS_EVENT_3
 
+  #define EVENT_TIMER_EXPIRE RTEMS_EVENT_4
+
   typedef RtemsBarrierReqWait_Context Context;
 
   static void Worker( rtems_task_argument arg )
@@ -215,7 +219,7 @@ test-support: |
 
       events = ReceiveAnyEvents();
 
-      if ( ( events & EVENT_CHECK_TIMER ) != 0 ) {
+      if ( ( events & EVENT_TIMER_INACTIVE ) != 0 ) {
         T_eq_int(
           T_get_thread_timer_state( ctx->main_id ),
           T_THREAD_TIMER_INACTIVE
@@ -262,6 +266,14 @@ test-support: |
         prio = SetSelfPriority( prio );
         T_eq_u32( prio, PRIO_HIGH );
       }
+
+      if ( ( events & EVENT_TIMER_EXPIRE ) != 0 ) {
+        T_eq_int(
+          T_get_thread_timer_state( ctx->main_id ),
+          T_THREAD_TIMER_SCHEDULED
+        );
+        FinalClockTick();
+      }
     }
   }
 test-target: testsuites/validation/tc-barrier-wait.c



More information about the vc mailing list