Skip to content

Comments

Fix #1503, Update timer interval comparison#1504

Merged
dzbaker merged 3 commits intonasa:mainfrom
pepepr08:1503-timer-ut-interval
Mar 27, 2025
Merged

Fix #1503, Update timer interval comparison#1504
dzbaker merged 3 commits intonasa:mainfrom
pepepr08:1503-timer-ut-interval

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)

@dzbaker dzbaker added CCB:Approved Indicates code review and approval by community CCB and removed CCB:Ready Pull request is ready for discussion at the Configuration Control Board (CCB) labels Mar 27, 2025
dzbaker added a commit to nasa/cFS that referenced this pull request Mar 27, 2025
*Combines:*

cFE equuleus-rc1+dev239
osal equuleus-rc1+dev101
PSP equuleus-rc1+dev61

**Includes:**

*cFE*
- nasa/cFE#2643

*osal*
- nasa/osal#1495
- nasa/osal#1499
- nasa/osal#1504
- nasa/osal#1502

*PSP*
- nasa/PSP#448
- nasa/PSP#450

Co-authored by: Anh Van <[email protected]>
Co-authored by: Jose Martinez Pedraza <[email protected]>
@dzbaker dzbaker merged commit b3cb5fa into nasa:main Mar 27, 2025
20 of 21 checks passed
dzbaker added a commit to nasa/cFS that referenced this pull request Mar 27, 2025
*Combines:*

cFE equuleus-rc1+dev239
osal equuleus-rc1+dev101
PSP equuleus-rc1+dev61

**Includes:**

*cFE*
- nasa/cFE#2643

*osal*
- nasa/osal#1495
- nasa/osal#1499
- nasa/osal#1504
- nasa/osal#1502

*PSP*
- nasa/PSP#448
- nasa/PSP#450

Co-authored by: Anh Van <[email protected]>
Co-authored by: Jose Martinez Pedraza <[email protected]>
@dzbaker dzbaker added this to the v7.0.0 milestone Feb 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CCB:Approved Indicates code review and approval by community CCB

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update osal_timer_UT inconsistent results

2 participants