Skip to content

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

Merged

Conversation

maciejbocianski
Copy link
Contributor

@maciejbocianski maciejbocianski commented Feb 22, 2018

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 (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.

#Related issues
#5284
#5046

Pull request type

  • Fix
  • Refactor
  • New Target
  • Feature

@0xc0170
Copy link
Contributor

0xc0170 commented Feb 22, 2018

#5284
#5046

This will unblock those 2 (fixes one and unblock TimerEvent PR) as I understand?

👍 for the description

@0xc0170
Copy link
Contributor

0xc0170 commented Feb 22, 2018

/morph build

@maciejbocianski
Copy link
Contributor Author

maciejbocianski commented Feb 22, 2018

Exactly

@mbed-ci
Copy link

mbed-ci commented Feb 22, 2018

Build : SUCCESS

Build number : 1216
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/6162/

Triggering tests

/morph test
/morph uvisor-test
/morph export-build
/morph mbed2-build

1 similar comment
@mbed-ci
Copy link

mbed-ci commented Feb 22, 2018

Build : SUCCESS

Build number : 1216
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/6162/

Triggering tests

/morph test
/morph uvisor-test
/morph export-build
/morph mbed2-build

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.
@maciejbocianski maciejbocianski force-pushed the sleep_manager_racecondition_test_fix branch from d3b0588 to 5aaad08 Compare February 22, 2018 10:36
@0xc0170
Copy link
Contributor

0xc0170 commented Feb 22, 2018

I aborted the test, needs to rerun as this PR was updated

/morph build

@mbed-ci
Copy link

mbed-ci commented Feb 22, 2018

Build : FAILURE

Build number : 1219
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/6162/

@maciejbocianski
Copy link
Contributor Author

[DEBUG] Return: 1
        [DEBUG] Errors: Error: Q9555E: Failed to check out a license.
        [DEBUG] Errors: Unable to connect to the license server. Check that ARMLMD_LICENSE_FILE is set correctly, and the license server is available.
        [DEBUG] Errors: Information about this error is available at: http://ds.arm.com/support/lic56/m96
        [DEBUG] Errors:  General licensing information is available at: http://ds.arm.com/support/licensing/
        [DEBUG] Errors:  If you need further help, provide this complete error report to your supplier or license.support@arm.com.
        [DEBUG] Errors:  - ARMLMD_LICENSE_FILE: '8225@10.10.10.101'
        [DEBUG] Errors:  - LM_LICENSE_FILE: unset
        [DEBUG] Errors:  - ARM_TOOL_VARIANT: unset
        [DEBUG] Errors:  - ARM_PRODUCT_PATH: unset
        [DEBUG] Errors:  - Product location: /usr/local/ARM_Compiler_5.06u3/sw/mappings
        [DEBUG] Errors:  - Toolchain location: /usr/local/ARM_Compiler_5.06u3/bin
        [DEBUG] Errors:  - Selected tool variant: product
        [DEBUG] Errors:  - Checkout feature: compiler5
        [DEBUG] Errors:  - Feature version: 5.0201605
        [DEBUG] Errors:  - Flex error code: -96
        [DEBUG] Errors: Product: ARM Compiler 5.06
        [DEBUG] Errors: Component: ARM Compiler 5.06 update 3 (build 300)
        [DEBUG] Errors: Tool: fromelf [4d35c3]
        [DEBUG] Errors: Finished: 3 information, 0 warning and 1 error messages.

@mbed-ci
Copy link

mbed-ci commented Feb 22, 2018

@0xc0170
Copy link
Contributor

0xc0170 commented Feb 22, 2018

/morph build

@mbed-ci
Copy link

mbed-ci commented Feb 22, 2018

Build : SUCCESS

Build number : 1220
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/6162/

Triggering tests

/morph test
/morph uvisor-test
/morph export-build
/morph mbed2-build

@mbed-ci
Copy link

mbed-ci commented Feb 22, 2018

@mbed-ci
Copy link

mbed-ci commented Feb 22, 2018

@cmonr cmonr merged commit 55f710f into ARMmbed:master Feb 23, 2018
@mbed-ci
Copy link

mbed-ci commented Feb 23, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants