-
Notifications
You must be signed in to change notification settings - Fork 3k
RTOS: Mutex: Rework tests #4729
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
Conversation
/morph test |
05ed1dd
to
fd4c31a
Compare
Result: FAILUREYour command has finished executing! Here's what you wrote!
OutputTest Prep failed! |
/morph test |
Result: SUCCESSYour command has finished executing! Here's what you wrote!
OutputAll builds and test passed! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Access to the variables change_counter
, changing_counter
and mutex_defect
shall be synchronized (critical section seems a good candidate).
They sort of are, it's an old test, that probably could be removed, but the variables you mentioned are manipulated inside the mutex protected zone and only if the mutex wouldn't work properly something 'bad' would happen. |
@bulislaw Those tests target mutexes behaviors. It shouldn't be assumed that mutexes work otherwise, what is the point of testing them ? |
Add descriptions, fix small issues and timings.
LGTM @pan- What do you think? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few ideas for new tests:
-
Test a continuous manipulation of a variable shared by many threads; without delay.
-
Add test of the thread state when a thread is blocked waiting on a mutex.
if (changing_counter == true) { | ||
result = false; | ||
mutex_defect = true; | ||
} | ||
changing_counter = true; | ||
|
||
change_counter++; | ||
core_util_critical_section_exit(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now, I'm thinking about, change_counter
Is the variable under test. It is maybe not the best to protect it with a critical section like other flags.
/morph test |
Result: FAILUREYour command has finished executing! Here's what you wrote!
OutputBuild failed! |
/morph test |
Result: SUCCESSYour command has finished executing! Here's what you wrote!
OutputAll builds and test passed! |
Add descriptions, fix small issues and timings
Status
READY