Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #2427, Race condition in TestCreateChild #2428

Merged
merged 1 commit into from
Aug 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion modules/cfe_testcase/src/es_task_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ void TestCreateChild(void)
size_t StackSize = CFE_PLATFORM_ES_PERF_CHILD_STACK_SIZE;
CFE_ES_TaskPriority_Atom_t Priority = CFE_PLATFORM_ES_PERF_CHILD_PRIORITY;
uint32 Flags = 0;
uint32 Index = 0;
int32 ExpectedCount = 5;
int32 RetryCount;
char TaskNameBuf[16];
Expand All @@ -110,7 +111,11 @@ void TestCreateChild(void)
CFE_FT_Global.Count = 0;
UtAssert_INT32_EQ(CFE_ES_CreateChildTask(&TaskId, TaskName, TaskFunction, StackPointer, StackSize, Priority, Flags),
CFE_SUCCESS);
OS_TaskDelay(500);
while (CFE_FT_Global.Count != ExpectedCount && Index < 100)
{
OS_TaskDelay(10);
Index ++;
}

UtAssert_INT32_GT(CFE_FT_Global.Count, ExpectedCount - 1);
UtAssert_INT32_LT(CFE_FT_Global.Count, ExpectedCount + 1);
Expand Down