Skip to content

Race condition in new idmap tests #493

@jphickey

Description

@jphickey

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugunit-testTickets related to the OSAL unit testing (functional and/or coverage)

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions