Skip to content

tests/kernel/preempt: Add yield and sleep cases #8133

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

Merged
merged 1 commit into from
Jun 5, 2018

Conversation

andyross
Copy link
Collaborator

@andyross andyross commented Jun 4, 2018

[Added test cases to try to catch the k_sleep() bug that Michael Scott and I were sure he had found in #8128. Alas, this test PASSES, and I've now convinced myself that the bug wasn't real (though the symptoms are and there may be a similar issue elsewhere, just now with k_sleep()). But they're useful regression cases and untested in current code, so worth commiting regardless]

Scheduler choice is subtle across yield and k_sleep(), add calls to
those to the state table and validate that we're making the right
decisions.

Signed-off-by: Andy Ross [email protected]

Scheduler choice is subtle across yield and k_sleep(), add calls to
those to the state table and validate that we're making the right
decisions.

Signed-off-by: Andy Ross <[email protected]>
@codecov-io
Copy link

Codecov Report

Merging #8133 into master will decrease coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #8133      +/-   ##
==========================================
- Coverage   64.54%   64.54%   -0.01%     
==========================================
  Files         420      420              
  Lines       40142    40142              
  Branches     6765     6765              
==========================================
- Hits        25911    25910       -1     
  Misses      11110    11110              
- Partials     3121     3122       +1
Impacted Files Coverage Δ
boards/posix/native_posix/timer_model.c 98.21% <0%> (-1.79%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7a18b08...e5b0f3c. Read the comment docs.

last_thread = NULL;
k_sem_give(&worker_sems[id]);

while (do_sleep
&& !(worker_threads[id].base.thread_state & _THREAD_PENDING)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't this test immediately break when you submit the k_sleep re-write for v1.13?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Likely, yes. :) But I'm whiteboxing the thread states here anyway and this is the easiest way to make sure the thread is blocked on the semaphore again before going to the next test case.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good. Removing my -1.

Copy link
Contributor

@mike-scott mike-scott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. But we should track for updates in v1.13.

@nashif nashif merged commit a803af2 into zephyrproject-rtos:master Jun 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants