-
Notifications
You must be signed in to change notification settings - Fork 3k
sleep_manager_racecondition test fix for devices with low CPU clock #6162
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
sleep_manager_racecondition test fix for devices with low CPU clock #6162
Conversation
/morph build |
Exactly |
Build : SUCCESSBuild number : 1216 Triggering tests/morph test |
1 similar comment
Build : SUCCESSBuild number : 1216 Triggering tests/morph test |
sleep_manager_racecondition test fix for devices with low CPU clock This RP contains fix for sleep_manager_racecondition test for very slow devices (like NRF51). It fixes the test itself as well as side effects of fix introduced in ARMmbed#5046 (us ticker: fix fire interrupt handling) The idea of the test was to test race condition between main thread and interrupt handler calling the same function. To efficiently test this, each handler call should interrupt main thread to make race more likely. On very slow devices (like NRF51) when we set very low ticker period (e.g less then 1000us for NRF51) there is no much time for thread scheduling. On such slow devices, setting period to 500 us cause that main thread is scheduled very rarely and only handler is constantly called making test unreliable. Fix introduced in ARMmbed#5046 (us ticker: fix fire interrupt handling) changed fire_interrupt function implementation causing more interrupt tailing thus even less time for main thread scheduling. After introduction of ARMmbed#5046 (us ticker: fix fire interrupt handling) when running sleep_manager_racecondition test on NRF51 (with ticker1.attach_us(&sleep_manager_locking_irq_test, 500);) test is failing with timeout due to the fact that interrupt handler is constantly called and main thread is never scheduled.
d3b0588
to
5aaad08
Compare
I aborted the test, needs to rerun as this PR was updated /morph build |
Build : FAILUREBuild number : 1219 |
|
Exporter Build : SUCCESSBuild number : 886 |
/morph build |
Build : SUCCESSBuild number : 1220 Triggering tests/morph test |
Exporter Build : SUCCESSBuild number : 889 |
Test : SUCCESSBuild number : 1019 |
Exporter Build : FAILUREBuild number : 895 |
Description
This RP contains fix for
sleep_manager_racecondition
test for very slow devices (like NRF51)It fixes the test itself as well as side effects of fix introduced in #5046 (us ticker: fix fire interrupt handling)
The idea of the test was to test race condition between main thread and interrupt handler calling the same function. To efficiently test this, each handler call should interrupt main thread to make race more likely. On very slow devices (like NRF51) when we set very low ticker period (e.g less then 1000us for NRF51) there is no much time for thread scheduling. On such slow devices, setting period to 500 us cause that main thread is scheduled very rarely and only handler is constantly called making test unreliable. Fix introduced in #5046 (us ticker: fix fire interrupt handling) changed
fire_interrupt
function implementation causing more interrupt tailing thus even less time for main thread scheduling.After introduction of #5046 (us ticker: fix fire interrupt handling) when running
sleep_manager_racecondition
test on NRF51 (withticker1.attach_us(&sleep_manager_locking_irq_test, 500);
) test is failing with timeout due to the fact that interrupt handler is constantly called and main thread is never scheduled.#Related issues
#5284
#5046
Pull request type