-
Notifications
You must be signed in to change notification settings - Fork 7
Add interval-based throttling tests for FindServerUTCTime #858
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
base: dev_sprint_25_2
Are you sure you want to change the base?
Conversation
Reason for change: Updates UTCTiming logic to skip sync if interval hasn’t elapsed. Add Configs to control the interval Test Procedure: updated in ticket Risks: Low Signed-off-by: Anurag Krishnan <akrish513@cable.comcast.com>
deprecated eAAMPConfig_UTCSyncOnErrorRetrySec fixed bug with config order causing runtime crash added some doxygen comments Signed-off-by: Philip Stroffolino <philip_stroffolino@cable.comcast.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Philip Stroffolino <philip_stroffolino@cable.comcast.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Philip Stroffolino <philip_stroffolino@cable.comcast.com>
Merge branch 'feature/VPLAY-12359_UTCTiming' of https://github.com/rdkcentral/aamp into feature/VPLAY-12359_UTCTiming Signed-off-by: Philip Stroffolino <philip_stroffolino@cable.comcast.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Philip Stroffolino <philip_stroffolino@cable.comcast.com>
Signed-off-by: Philip Stroffolino <philip_stroffolino@cable.comcast.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Extended FindServerUTCTime test coverage with 5 new test cases: 1. SyncOnStartup - Verify initial sync when UTCSyncOnStartup enabled 2. SkipSyncBeforeInterval - Verify sync skipped when interval not elapsed 3. SyncAfterInterval - Verify sync occurs when interval has elapsed 4. UseCachedOffset - Verify cached offset used when sync skipped 5. NoSyncWhenStartupDisabled - Verify no sync when startup disabled These tests verify the interval-based throttling behavior including: - Network sync calls only when appropriate - Cached offset usage between sync intervals - Proper time progression and interval checking - Configuration setting behavior Addresses PR feedback on #853 for comprehensive UTC sync testing. Co-authored-by: pstroffolino <20442081+pstroffolino@users.noreply.github.com>
Signed-off-by: Philip Stroffolino <philip_stroffolino@cable.comcast.com>
…kcentral/aamp into feature/VPLAY-12359_UTCTiming
|
@copilot this new tests crash with null pointer deference |
|
@copilot I marked them with GTEST_SKIP() temporarily. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot wasn't able to review any files in this pull request.
Added null check for mMPDParseHelper before calling SetLocalTimeDelta to prevent crashes when the helper is not initialized. This makes the function more defensive and allows unit tests to call FindServerUTCTime directly without requiring full MPD initialization. Removed GTEST_SKIP() from all 5 UTC sync tests: - FindServerUTCTime_SyncOnStartup - FindServerUTCTime_SkipSyncBeforeInterval - FindServerUTCTime_SyncAfterInterval - FindServerUTCTime_UseCachedOffset - FindServerUTCTime_NoSyncWhenStartupDisabled Tests now run successfully with the null check in place. Co-authored-by: pstroffolino <20442081+pstroffolino@users.noreply.github.com>
Fixed in commit be0bbf7. The crash was caused by Added a null check before the call to make the function defensive. All 5 tests now run without crashes. |
Fix null pointer dereference in FindServerUTCTime tests
Issue
The new UTC sync throttling tests were crashing with null pointer dereference when calling
FindServerUTCTimedirectly.Root Cause
The
FindServerUTCTimeimplementation callsmMPDParseHelper->SetLocalTimeDelta(mDeltaTime)at the end, butmMPDParseHelperis initialized to NULL in the constructor and only gets set during full MPD initialization viaGetMPDParseHelper().When unit tests call
FindServerUTCTimedirectly with just an XML node (bypassingInitializeMPD), the helper remains null, causing a crash.Fix
Added defensive null check before calling
SetLocalTimeDelta:This makes the function more robust and allows it to be tested in isolation without requiring full MPD setup.
Changes
mMPDParseHelperGTEST_SKIP()from all 5 tests to enable themAll tests now run successfully without crashes.
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.