From ca8889d918cc816e4dc0568cceb34bae8b6de67d Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Tue, 25 Oct 2022 10:22:21 -0400 Subject: [PATCH 1/2] Fix #1318, adjust timing on condvar tests The order of task wakeup when using OS_CondVarSignal() with multiple tasks pending may not be guaranteed. This relaxes the test case so that a specific order is not assumed/required. This also adjust certain sleep times to make sure the test waits long enough for the tasks to do the expected work. --- src/tests/condvar-test/condvar-test.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/tests/condvar-test/condvar-test.c b/src/tests/condvar-test/condvar-test.c index cb51d3d32..59d2ede78 100644 --- a/src/tests/condvar-test/condvar-test.c +++ b/src/tests/condvar-test/condvar-test.c @@ -90,7 +90,7 @@ void condvar_worker(uint32 my_num) ++my_state->run_count; UtPrintf("Doing Work task %u, mask=0x%x condition was=%x\n", (unsigned int)my_num, (unsigned int)my_state->mask, (unsigned int)prev_condition); - OS_TaskDelay(50 + (NUM_TASKS * 5)); + OS_TaskDelay(25 + (NUM_TASKS * 5)); } } @@ -169,7 +169,6 @@ void CondVarTest_Execute(void) UtAssert_UINT32_EQ(total_work, num_signals); UtAssert_UINT32_NEQ(curr_condition, ALL_RUN_CONDITION); UtAssert_UINT32_NEQ(curr_condition, 0); - UtAssert_UINT32_EQ(task_states[i].run_count, 1); UtAssert_INT32_EQ(OS_CondVarUnlock(condvar_id), OS_SUCCESS); UtAssert_INT32_EQ(OS_CondVarSignal(condvar_id), OS_SUCCESS); @@ -180,13 +179,19 @@ void CondVarTest_Execute(void) /* after a the last signal, all the other tasks should have run */ UtAssert_INT32_EQ(OS_CondVarLock(condvar_id), OS_SUCCESS); + for (i = 0; i < NUM_TASKS; ++i) + { + UtAssert_UINT32_EQ(task_states[i].run_count, 1); + } UtAssert_UINT32_EQ(total_work, num_signals); UtAssert_BITMASK_UNSET(curr_condition, ALL_RUN_CONDITION); curr_condition = ALL_RUN_CONDITION; UtAssert_INT32_EQ(OS_CondVarBroadcast(condvar_id), OS_SUCCESS); UtAssert_INT32_EQ(OS_CondVarUnlock(condvar_id), OS_SUCCESS); - OS_TaskDelay(100); + /* Give sufficient time for all tasks to wake up and do their work */ + OS_TaskDelay(100 + (NUM_TASKS * 10)); + UtAssert_INT32_EQ(OS_CondVarLock(condvar_id), OS_SUCCESS); UtAssert_BITMASK_UNSET(curr_condition, ALL_RUN_CONDITION); for (i = 0; i < NUM_TASKS; ++i) @@ -198,7 +203,8 @@ void CondVarTest_Execute(void) UtAssert_INT32_EQ(OS_CondVarBroadcast(condvar_id), OS_SUCCESS); UtAssert_INT32_EQ(OS_CondVarUnlock(condvar_id), OS_SUCCESS); - OS_TaskDelay(20); + /* Give sufficient time for all tasks to wake up and do their work */ + OS_TaskDelay(100 + (NUM_TASKS * 10)); UtAssert_INT32_EQ(OS_CondVarLock(condvar_id), OS_SUCCESS); UtAssert_UINT32_EQ(total_work, (NUM_TASKS * 2) + 1); From c79db7a6bb4b9a003788e04bde718ba8a2c23d73 Mon Sep 17 00:00:00 2001 From: Dylan Date: Wed, 26 Oct 2022 10:13:37 -0400 Subject: [PATCH 2/2] Bump to v7.0.0-rc4+dev147 --- CHANGELOG.md | 6 +++++- src/os/inc/osapi-version.h | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a77fb72b..35732746e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ # Changelog -## Development Build: v6.0.0-rc4:dev143 +## Development Build: v6.0.0-rc4+dev147 +- adjust timing on condvar tests +- See + +## Development Build: v6.0.0-rc4+dev143 - locks for condvar objects on rtems/vxworks - Add time conversion reciprocal functions - add export targets and package script diff --git a/src/os/inc/osapi-version.h b/src/os/inc/osapi-version.h index ced728c20..6d882e14a 100644 --- a/src/os/inc/osapi-version.h +++ b/src/os/inc/osapi-version.h @@ -34,7 +34,7 @@ /* * Development Build Macro Definitions */ -#define OS_BUILD_NUMBER 143 +#define OS_BUILD_NUMBER 147 #define OS_BUILD_BASELINE "v6.0.0-rc4" /*