From a877097daeb9c6f4098af86b11d2d7e1d84008ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaquim=20St=C3=A4hli?= Date: Tue, 19 Mar 2024 09:02:24 +0100 Subject: [PATCH] Fix flaky ci test --- .../srgssr/pillarbox/player/tracker/MediaItemTrackerTest.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pillarbox-player/src/test/java/ch/srgssr/pillarbox/player/tracker/MediaItemTrackerTest.kt b/pillarbox-player/src/test/java/ch/srgssr/pillarbox/player/tracker/MediaItemTrackerTest.kt index 3c256461f..0e6435096 100644 --- a/pillarbox-player/src/test/java/ch/srgssr/pillarbox/player/tracker/MediaItemTrackerTest.kt +++ b/pillarbox-player/src/test/java/ch/srgssr/pillarbox/player/tracker/MediaItemTrackerTest.kt @@ -372,14 +372,16 @@ class MediaItemTrackerTest { } TestPlayerRunHelper.runUntilPlaybackState(player, Player.STATE_READY) - TestPlayerRunHelper.runUntilTimelineChanged(player) - fakeClock.advanceTime(FakeAssetLoader.NEAR_END_POSITION_MS) + TestPlayerRunHelper.runUntilPlaybackState(player, Player.STATE_ENDED) + + TestPlayerRunHelper.runUntilPendingCommandsAreFullyHandled(player) verifyOrder { fakeMediaItemTracker.start(player, FakeMediaItemTracker.Data(firstMediaId)) fakeMediaItemTracker.stop(player, MediaItemTracker.StopReason.EoF, any()) fakeMediaItemTracker.start(player, FakeMediaItemTracker.Data(secondMediaId)) + fakeMediaItemTracker.stop(player, MediaItemTracker.StopReason.EoF, any()) } confirmVerified(fakeMediaItemTracker) }