mirror of
https://github.com/samsonjs/media.git
synced 2026-04-05 11:15:46 +00:00
Fix flaky test.
The test was flaky because it didn't wait for pending commands to finish after pausing the test playback. Also add more debug information to the toString() method because the expected and actual state only differed in the nextAdGroupIndex in the flaky case. PiperOrigin-RevId: 313175919
This commit is contained in:
parent
0add067eaa
commit
45b574d593
1 changed files with 5 additions and 0 deletions
|
|
@ -874,7 +874,9 @@ public final class AnalyticsCollectorTest {
|
|||
// Wait in each content part to ensure previously triggered events get a chance to be
|
||||
// delivered. This prevents flakiness caused by playback progressing too fast.
|
||||
.playUntilPosition(/* windowIndex= */ 0, /* positionMs= */ 3_000)
|
||||
.waitForPendingPlayerCommands()
|
||||
.playUntilPosition(/* windowIndex= */ 0, /* positionMs= */ 8_000)
|
||||
.waitForPendingPlayerCommands()
|
||||
.play()
|
||||
.waitForPlaybackState(Player.STATE_ENDED)
|
||||
// Wait for final timeline change that marks post-roll played.
|
||||
|
|
@ -1361,6 +1363,9 @@ public final class AnalyticsCollectorTest {
|
|||
: "")
|
||||
+ ", period.hashCode="
|
||||
+ mediaPeriodId.periodUid.hashCode()
|
||||
+ (mediaPeriodId.nextAdGroupIndex != C.INDEX_UNSET
|
||||
? ", nextAdGroup=" + mediaPeriodId.nextAdGroupIndex
|
||||
: "")
|
||||
+ '}'
|
||||
: "{" + "window=" + windowIndex + ", period = null}";
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue