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

Race condition in new idmap tests #493

Closed
jphickey opened this issue Jun 9, 2020 · 0 comments · Fixed by #495
Closed

Race condition in new idmap tests #493

jphickey opened this issue Jun 9, 2020 · 0 comments · Fixed by #495
Labels
bug unit-test Tickets related to the OSAL unit testing (functional and/or coverage)
Milestone

Comments

@jphickey
Copy link
Contributor

jphickey commented Jun 9, 2020

Describe the bug
The idmap-api-test routine occasionally fails, because it creates one of its semaphores in a sub task, but does not actually wait for that sub task to run.

To Reproduce
Run idmap test, in particular a single core machine seems to reproduce it more reliably.

Expected behavior
Need to add a wait loop of some type in main task to make sure child task has executed.

Code snips
Task started here:

OS_TaskCreate( &task_id, "Task", Test_Void_Fn, 0, 0, 0, 0);

Might want to employ a loop similar to what is done here to make sure the child task has executed:

loopcnt = 0;
while ((OS_TaskGetInfo(TaskData[tasknum].task_id, &taskprop) == OS_SUCCESS) && (loopcnt < UT_EXIT_LOOP_MAX))
{
OS_TaskDelay(10);
loopcnt++;
}

System observed on:
CentOS 6.9 VM (single core)

Reporter Info
Joseph Hickey, Vantage Systems, Inc.

astrogeco added a commit that referenced this issue Jun 10, 2020
@astrogeco astrogeco added this to the v5.1.0 milestone Sep 21, 2020
@astrogeco astrogeco added unit-test Tickets related to the OSAL unit testing (functional and/or coverage) bug labels Sep 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug unit-test Tickets related to the OSAL unit testing (functional and/or coverage)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants