Commit 8386d617 by olly Committed by Oliver Woodman

Fix OOM-is-prevented test OOM-ing :)

This test is intended to check that DefaultLoadControl will cause
playback to fail as "stuck buffering" rather than OOM-ing, in the
case that its target buffer size is reached and playback still
hasn't started.

Unfortunately, the target buffer size is ~130MB, and when running
on some setups an OOM actually ends up happening before this much
memory is allocated.

This change makes the target buffer size much smaller to avoid the
problem.

PiperOrigin-RevId: 331748208
parent 9a01e6cf
...@@ -7330,6 +7330,10 @@ public final class ExoPlayerTest { ...@@ -7330,6 +7330,10 @@ public final class ExoPlayerTest {
@Test @Test
public void public void
infiniteLoading_withSmallAllocations_oomIsPreventedByLoadControl_andThrowsStuckBufferingIllegalStateException() { infiniteLoading_withSmallAllocations_oomIsPreventedByLoadControl_andThrowsStuckBufferingIllegalStateException() {
DefaultLoadControl loadControl =
new DefaultLoadControl.Builder()
.setTargetBufferBytes(10 * C.DEFAULT_BUFFER_SEGMENT_SIZE)
.build();
MediaSource continuouslyAllocatingMediaSource = MediaSource continuouslyAllocatingMediaSource =
new FakeMediaSource( new FakeMediaSource(
new FakeTimeline(/* windowCount= */ 1), ExoPlayerTestRunner.VIDEO_FORMAT) { new FakeTimeline(/* windowCount= */ 1), ExoPlayerTestRunner.VIDEO_FORMAT) {
...@@ -7387,6 +7391,7 @@ public final class ExoPlayerTest { ...@@ -7387,6 +7391,7 @@ public final class ExoPlayerTest {
new ExoPlayerTestRunner.Builder(context) new ExoPlayerTestRunner.Builder(context)
.setActionSchedule(actionSchedule) .setActionSchedule(actionSchedule)
.setMediaSources(continuouslyAllocatingMediaSource) .setMediaSources(continuouslyAllocatingMediaSource)
.setLoadControl(loadControl)
.build(); .build();
ExoPlaybackException exception = ExoPlaybackException exception =
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment