diff --git a/player/playback-engine/src/test/kotlin/com/tidal/sdk/player/playbackengine/ExoPlayerPlaybackEngineTest.kt b/player/playback-engine/src/test/kotlin/com/tidal/sdk/player/playbackengine/ExoPlayerPlaybackEngineTest.kt index 17c935ed..34208f7f 100644 --- a/player/playback-engine/src/test/kotlin/com/tidal/sdk/player/playbackengine/ExoPlayerPlaybackEngineTest.kt +++ b/player/playback-engine/src/test/kotlin/com/tidal/sdk/player/playbackengine/ExoPlayerPlaybackEngineTest.kt @@ -274,8 +274,15 @@ internal class ExoPlayerPlaybackEngineTest { } @Test - fun loadShouldSetCorrectPropertiesAndPreparePlayerWithCorrectMediaSource() = runBlocking { - playbackEngine.load(forwardingMediaProduct.delegate) + fun loadShouldSetCorrectPropertiesAndPreparePlayerWithCorrectMediaSource() { + runBlocking { + withTimeout(8.seconds) { + playbackEngine.events.filter { it is Event.MediaProductTransition }.first() + } + launch { + playbackEngine.load(forwardingMediaProduct.delegate) + } + } assertThat(playbackEngine.mediaProduct).isEqualTo(forwardingMediaProduct.delegate) assertThat(playbackEngine.testNextMediaSource).isEqualTo(null) @@ -287,7 +294,7 @@ internal class ExoPlayerPlaybackEngineTest { } @Test - fun nextShouldDoNothingIfPlaybackStateIsIdle() = runBlocking { + fun nextShouldDoNothingIfPlaybackStateIsIdle() { playbackEngine.setNext(forwardingMediaProduct.delegate) verify(initialExtendedExoPlayer, never())