test(e2e): harden recording and outgoing-call waits against backend latency - #1751
Conversation
…atency The composite recorder can take 20-30s to start and emit call.recording_started, and the outgoing ringing screen only renders after the call create/ring network round-trip. The 5s default (recording icon) and 10s (outgoing decline button) waits time out before the UI appears, causing deterministic findObject NPEs in testParticipantRecordsCall and testUserRejectsTheOutgoingAudioCall. Co-authored-by: Cursor <cursoragent@cursor.com>
PR checklist ✅All required conditions are satisfied:
🎉 Great job! This PR is ready for review. |
WalkthroughThe E2E call assertions now allow longer waits for the recording indicator and outgoing-call decline button to accommodate delayed UI rendering. ChangesE2E UI assertions
Estimated code review effort: 1 (Trivial) | ~5 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
SDK Size Comparison 📏
|
The recording-consent dialog (acceptCallRecording/declineCallRecording) and the recording-icon disappear assert are all gated on backend recorder events (call.recording_started / call.recording_stopped), which can take 20-30s. The 10s/5s waits time out first, so testParticipantRecordsCall still failed at acceptCallRecording after the initial icon-wait bump. Extend these waits to 30s. Co-authored-by: Cursor <cursoragent@cursor.com>
Composite recording spins up ~10-15s after the request, so recording for only 15s left a ~5s client-visible window that closed before the 3-view assertion loop could observe the icon. Record for 60s and keep the buddy in the call for 120s (matching the ReconnectionTests pattern) so the icon is reliably visible, then extend the "recording disappeared" wait to 70s to cover the longer run. Co-authored-by: Cursor <cursoragent@cursor.com>
|
|
🚀 Available in v1.30.0 |



Goal
Closes AND-1323
Two demo-app E2E tests fail deterministically on
develop(and on any PR that runs theTest composeshard) because the tests assume the backend produces UI state faster than it actually does:ParticipantActionsTests.testParticipantRecordsCallRingingTests.testUserRejectsTheOutgoingAudioCallBoth surfaced as
java.lang.NullPointerException: findObject(...) must not be nullwhen awaitToAppeartimed out before the expected element rendered. Captured logcats confirmed the SDK receives and handles the relevant events correctly (CallRecordingStartedEvent/CallRecordingStoppedEvent) — the failures are purely test-timing assumptions vs. backend latency.Root cause of the recording test: the composite recorder takes ~10-15s to spin up before it emits
call.recording_started. The buddy was told to record for only 15s, so ~10s of spin-up left just a ~5s client-visible window — which closed before the 3-view assertion loop (GRID,DYNAMIC,SPOTLIGHT) could observe the recording icon. No timeout increase can fix a window that has already closed, so the real fix is to record long enough that the icon is reliably observable.Implementation
All changes are confined to
demo-app/src/androidTestE2etestingDebug— no production/SDK code is touched.Recording test (
testParticipantRecordsCall) — the core fix:60s(was15s) so the icon is reliably visible across all three views after the ~10-15s spin-up.120sviasetCallDuration(120)(buddy default is 30s) so the 60s recording runs to completion instead of being cut off when the buddy leaves — mirrors the existingReconnectionTestspattern.assertRecordingView(isDisplayed = false)icon-disappear wait5s → 70s, since the recording now runs ~60s beforecall.recording_stopped.waitToDisappearreturns as soon as the icon is gone, so the longer timeout is only fully spent while recording is still running.acceptCallRecording()/declineCallRecording()consent-dialog wait10s → 30s— the dialog only appears oncall.recording_started(~10-15s in).assertRecordingView(isDisplayed = true)icon-appear wait5s → 30s.Ringing test (
testUserRejectsTheOutgoingAudioCall):assertOutgoingCall(isDisplayed = true)decline-button wait10s → 20s— the outgoing ringing screen only renders after the call create/ring network round-trip, which can exceed 10s under CI load.Testing
Test composeshard on CI —testParticipantRecordsCallandtestUserRejectsTheOutgoingAudioCallnow pass./gradlew :demo-app:spotlessApply— formatting clean☑️Contributor Checklist
General
developbranchCode & documentation
stream-video-examples) (N/A)☑️Reviewer Checklist