Skip to content

Commit 7f6a006

Browse files
andremionrahul-lohra
authored andcommitted
Absorb stale reads in the recording icon assert
The develop nightly on API 34 leaked a raw StaleObjectException from assertRecordingView: waitToAppear absorbs staleness while waiting, but the returned node can go stale before isDisplayed() reads visibleCenter. Use the stale-safe waitDisplayed with the same 30s window, so the real failure is reported instead of the stale read.
1 parent 2143ef5 commit 7f6a006

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

demo-app/src/androidTestE2etestingDebug/kotlin/io/getstream/video/android/robots/UserRobotCallAsserts.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,12 @@ fun UserRobot.assertRecordingView(isDisplayed: Boolean): UserRobot {
206206
if (isDisplayed) {
207207
// The backend composite recorder can take 20-30s to actually start and emit
208208
// call.recording_started, so the icon needs a longer window than the 5s default.
209-
assertTrue(CallPage.recordingIcon.waitToAppear(timeOutMillis = 30.seconds).isDisplayed())
209+
// waitDisplayed also absorbs stale reads: the node returned by waitToAppear could
210+
// go stale before isDisplayed() and leak a StaleObjectException.
211+
assertTrue(
212+
"Recording icon",
213+
CallPage.recordingIcon.waitDisplayed(timeOutMillis = 30.seconds),
214+
)
210215
// After a network drop the label can briefly read "Reconnecting.." before it settles
211216
// back to "Recording", so poll instead of asserting on the first read.
212217
val callInfoText = CallPage.callInfoView.waitForText(

0 commit comments

Comments
 (0)