Skip to content
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

Fix #1503, Update timer interval comparison #1504

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

pepepr08
Copy link
Contributor

@pepepr08 pepepr08 commented Mar 20, 2025

Checklist (Please check before submitting)

Describe the contribution

  • Fixes Update osal_timer_UT inconsistent results #1503 The timer test logic was relying on undefined/non-guaranteed behavior.
  • Also updated the start time used for timers to improve accuracy and make test pass on slower/less accurate systems.
  • Updated workflow to do an apt update before the apt install

Testing performed
Steps taken to test the contribution:

  1. Build and run tests

Expected behavior changes
A clear and concise description of how this contribution will change behavior and level of impact.

  • Test now passes on RTEMS / LEON3

System(s) tested on

  • RTEMS 5 / LEON3

Additional context
Add any other context about the contribution here.

Third party code
If included, identify any third party code and provide text file of license

Contributor Info - All information REQUIRED for consideration of pull request
Jose F Martinez Pedraza / GSFC 582

@pepepr08 pepepr08 force-pushed the 1503-timer-ut-interval branch from 27ebb2c to 1cf3c3c Compare March 21, 2025 14:50
@pepepr08 pepepr08 force-pushed the 1503-timer-ut-interval branch from d248855 to b69ff3f Compare March 21, 2025 15:26
@pepepr08 pepepr08 added the CCB:Ready Pull request is ready for discussion at the Configuration Control Board (CCB) label Mar 21, 2025
@pepepr08 pepepr08 requested a review from jphickey March 21, 2025 15:27
@pepepr08 pepepr08 marked this pull request as ready for review March 21, 2025 15:30
@pepepr08
Copy link
Contributor Author

test using OSAL timer API:

[ FAIL] 05.011 ut_ostimer_timerio_test.c:489 - g_timerGlobal.minDiff (442583) > intervalTime - (intervalTime / 20) (475000)
[ PASS] 05.012 ut_ostimer_timerio_test.c:490 - g_timerGlobal.maxDiff (500000) < intervalTime + (intervalTime / 20) (525000)
[ FAIL] 05.013 ut_ostimer_timerio_test.c:494 - totalTime / g_timerGlobal.callbackMax (494257) > intervalTime - (intervalTime / 200) (497500)
[ PASS] 05.014 ut_ostimer_timerio_test.c:495 - totalTime / g_timerGlobal.callbackMax (494257) < intervalTime + (intervalTime / 200) (502500)

directly using RTEMS timer:

[ PASS] 05.010 ut_ostimer_timerio_test.c:588 - g_timerGlobal.minDiff (499990) > intervalTime - (intervalTime / 20) (475000)
[ PASS] 05.011 ut_ostimer_timerio_test.c:589 - g_timerGlobal.maxDiff (500000) < intervalTime + (intervalTime / 20) (525000)
[ PASS] 05.012 ut_ostimer_timerio_test.c:593 - totalTime / g_timerGlobal.callbackMax (499999) > intervalTime - (intervalTime / 200) (497500)
[ PASS] 05.013 ut_ostimer_timerio_test.c:594 - totalTime / g_timerGlobal.callbackMax (499999) < intervalTime + (intervalTime / 200) (502500)

using g_clkAccuracy*5:

[ PASS] 05.011 ut_ostimer_timerio_test.c:489 - g_timerGlobal.minDiff (499975) > intervalTime - (intervalTime / 20) (475000)
[ PASS] 05.012 ut_ostimer_timerio_test.c:490 - g_timerGlobal.maxDiff (500001) < intervalTime + (intervalTime / 20) (525000)
[ PASS] 05.013 ut_ostimer_timerio_test.c:494 - totalTime / g_timerGlobal.callbackMax (499997) > intervalTime - (intervalTime / 200) (497500)
[ PASS] 05.014 ut_ostimer_timerio_test.c:495 - totalTime / g_timerGlobal.callbackMax (499997) < intervalTime + (intervalTime / 200) (502500)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CCB:Ready Pull request is ready for discussion at the Configuration Control Board (CCB)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update osal_timer_UT inconsistent results
1 participant