diff --git a/library/core/src/androidTest/java/com/google/android/exoplayer2/ClippedPlaybackTest.java b/library/core/src/androidTest/java/com/google/android/exoplayer2/ClippedPlaybackTest.java index b7f05b0869..9e757574b8 100644 --- a/library/core/src/androidTest/java/com/google/android/exoplayer2/ClippedPlaybackTest.java +++ b/library/core/src/androidTest/java/com/google/android/exoplayer2/ClippedPlaybackTest.java @@ -82,6 +82,7 @@ public final class ClippedPlaybackTest { playbackEnded.block(); getInstrumentation().runOnMainSync(() -> player.get().release()); + getInstrumentation().waitForIdleSync(); assertThat(Iterables.getOnlyElement(Iterables.concat(textOutput.cues)).text.toString()) .isEqualTo("This is the first subtitle."); } @@ -135,6 +136,7 @@ public final class ClippedPlaybackTest { playbackEnded.block(); getInstrumentation().runOnMainSync(() -> player.get().release()); + getInstrumentation().waitForIdleSync(); assertThat(Iterables.getOnlyElement(Iterables.concat(textOutput.cues)).text.toString()) .isEqualTo("This is the first subtitle."); }