Skip to content

Fix flaky unit test in video sdk#1653

Merged
PratimMallick merged 1 commit into
developfrom
fix/rahullohra/fix-ut
Apr 21, 2026
Merged

Fix flaky unit test in video sdk#1653
PratimMallick merged 1 commit into
developfrom
fix/rahullohra/fix-ut

Conversation

@rahul-lohra
Copy link
Copy Markdown
Contributor

@rahul-lohra rahul-lohra commented Apr 21, 2026

Goal

Fix flaky unit test

Implementation

Fix flaky unit test

🎨 UI Changes

None

Testing

None

Summary by CodeRabbit

  • Tests
    • Improved test reliability for audio execution context validation by refining concurrent task synchronization.

@rahul-lohra rahul-lohra self-assigned this Apr 21, 2026
@rahul-lohra rahul-lohra added the pr:internal Internal or infra-only changes label Apr 21, 2026
@rahul-lohra rahul-lohra requested a review from a team as a code owner April 21, 2026 08:47
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 21, 2026

PR checklist ✅

All required conditions are satisfied:

  • Title length is OK (or ignored by label).
  • At least one pr: label exists.
  • Sections ### Goal, ### Implementation, and ### Testing are filled.

🎉 Great job! This PR is ready for review.

@rahul-lohra rahul-lohra changed the title Fix flaky unit test Fix flaky unit test in video sdk Apr 21, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 21, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: b1af339a-b968-4750-8d34-67de71bc440c

📥 Commits

Reviewing files that changed from the base of the PR and between 7e360ce and 8f62da1.

📒 Files selected for processing (1)
  • stream-video-android-core/src/test/kotlin/io/getstream/video/android/core/audio/AudioExecutionContextTest.kt

Walkthrough

The test file replaces advanceUntilIdle() with job1.join() to explicitly wait for a specific coroutine job's completion, improving test synchronization and removing a test framework dependency.

Changes

Cohort / File(s) Summary
Test Synchronization Update
stream-video-android-core/src/test/kotlin/io/getstream/video/android/core/audio/AudioExecutionContextTest.kt
Modified failure in one child should not affect another test to use direct job join instead of scheduler advancement for waiting on coroutine completion; removed advanceUntilIdle import.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A test that waits with patient grace,
No more advancing time and space,
Just join the job, let logic flow,
One sibling falls, the other's go!
Coroutines dance in harmony true. ✨

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive The description is largely incomplete and overly generic. While it follows the template structure, the 'Goal' and 'Implementation' sections only repeat 'Fix flaky unit test' without explaining why the test was flaky, what the specific issue was, or how the fix addresses it. Expand the 'Implementation' section to explain the root cause of the flakiness (advanceUntilIdle timing issues) and why the fix (using job.join()) is more reliable.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change—fixing a flaky unit test in the video SDK, which matches the code modification that replaces unreliable timing logic with explicit waits.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/rahullohra/fix-ut

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown
Contributor

SDK Size Comparison 📏

SDK Before After Difference Status
stream-video-android-core 12.02 MB 12.02 MB 0.00 MB 🟢
stream-video-android-ui-xml 5.68 MB 5.68 MB 0.00 MB 🟢
stream-video-android-ui-compose 6.28 MB 6.28 MB 0.00 MB 🟢

@sonarqubecloud
Copy link
Copy Markdown

@PratimMallick PratimMallick merged commit 62a3d08 into develop Apr 21, 2026
13 of 15 checks passed
@PratimMallick PratimMallick deleted the fix/rahullohra/fix-ut branch April 21, 2026 09:25
@stream-public-bot stream-public-bot added the released Included in a release label Apr 23, 2026
@stream-public-bot
Copy link
Copy Markdown
Collaborator

🚀 Available in v1.22.0

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

Labels

pr:internal Internal or infra-only changes released Included in a release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants