From 76f727e7c3ba9e064d2a836ae815980d38380e09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Muller?= Date: Fri, 16 Feb 2024 15:27:38 +0100 Subject: [PATCH] Update KotlinX Coroutines to 1.8.0 (#443) --- gradle/libs.versions.toml | 2 +- .../core/business/CommandersActTrackerTest.kt | 21 +++++++++---------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index bb09d6069..f8600cbd5 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -28,7 +28,7 @@ jacoco = "0.8.11" json = "20231013" junit = "4.13.2" kotlin = "1.9.22" -kotlinx-coroutines = "1.7.3" +kotlinx-coroutines = "1.8.0" kotlinx-kover = "0.7.5" kotlinx-serialization = "1.6.2" ktor = "2.3.8" diff --git a/pillarbox-core-business/src/androidTest/java/ch/srgssr/pillarbox/core/business/CommandersActTrackerTest.kt b/pillarbox-core-business/src/androidTest/java/ch/srgssr/pillarbox/core/business/CommandersActTrackerTest.kt index 54d96f367..ef9d5a3b0 100644 --- a/pillarbox-core-business/src/androidTest/java/ch/srgssr/pillarbox/core/business/CommandersActTrackerTest.kt +++ b/pillarbox-core-business/src/androidTest/java/ch/srgssr/pillarbox/core/business/CommandersActTrackerTest.kt @@ -60,7 +60,7 @@ class CommandersActTrackerTest { } @Test - fun testStartEoF() = runTest(timeout = TEST_TIMEOUT) { + fun testStartEoF() = runTest { val expected = listOf( MediaEventType.Play.toString(), MediaEventType.Eof.toString() @@ -76,7 +76,7 @@ class CommandersActTrackerTest { } @Test - fun testPlayStop() = runTest(timeout = TEST_TIMEOUT) { + fun testPlayStop() = runTest { val expected = listOf( MediaEventType.Play.toString(), MediaEventType.Stop.toString() @@ -89,7 +89,7 @@ class CommandersActTrackerTest { } @Test - fun testPlaySeekPlay() = runTest(timeout = TEST_TIMEOUT) { + fun testPlaySeekPlay() = runTest { val seekPositionMs = 2_000L val expectedEvents = listOf( CommandersActDelegate.Event(MediaEventType.Play.toString(), 0L), @@ -110,7 +110,7 @@ class CommandersActTrackerTest { * Seek event is not send but play event position should be the seek position. */ @Test - fun testPausePlaySeekPlay() = runTest(timeout = TEST_TIMEOUT) { + fun testPausePlaySeekPlay() = runTest { val seekPositionMs = 2_000L val expected = listOf( CommandersActDelegate.Event(MediaEventType.Play.toString(), seekPositionMs.milliseconds.inWholeSeconds), @@ -126,7 +126,7 @@ class CommandersActTrackerTest { } @Test - fun testPlayPauseSeekPause() = runTest(timeout = TEST_TIMEOUT) { + fun testPlayPauseSeekPause() = runTest { val seekPositionMs = 4_000L val expected = listOf( MediaEventType.Play.toString(), @@ -147,7 +147,7 @@ class CommandersActTrackerTest { @FlakyTest(detail = "POS and UPTIME not always send due to timers") @Test - fun testPosTime() = runTest(timeout = TEST_TIMEOUT) { + fun testPosTime() = runTest { val expected = listOf( MediaEventType.Pos.toString(), MediaEventType.Pos.toString(), @@ -165,7 +165,7 @@ class CommandersActTrackerTest { @FlakyTest(detail = "POS and UPTIME not always send due to timers") @Test - fun testUpTime() = runTest(timeout = TEST_TIMEOUT) { + fun testUpTime() = runTest { val expected = listOf( MediaEventType.Uptime.toString(), MediaEventType.Uptime.toString(), @@ -183,7 +183,7 @@ class CommandersActTrackerTest { @FlakyTest(detail = "POS and UPTIME not always send due to timers") @Test - fun testUpTimeLiveWithDvr() = runTest(timeout = TEST_TIMEOUT) { + fun testUpTimeLiveWithDvr() = runTest { val expected = listOf( MediaEventType.Uptime.toString(), MediaEventType.Uptime.toString(), @@ -200,7 +200,7 @@ class CommandersActTrackerTest { @FlakyTest @Test - fun testUpTimeLiveWithDvrTimeShift() = runTest(timeout = TEST_TIMEOUT) { + fun testUpTimeLiveWithDvrTimeShift() = runTest { val seekPosition = 80.seconds commandersActDelegate.ignorePeriodicEvents = false launch(Dispatchers.Main) { @@ -218,7 +218,7 @@ class CommandersActTrackerTest { } @Test - fun testPauseSeekPause() = runTest(timeout = TEST_TIMEOUT) { + fun testPauseSeekPause() = runTest { val seekPositionMs = 4_000L launch(Dispatchers.Main) { val player = createPlayerWithUrn(LocalMediaCompositionDataSource.Vod, false) @@ -301,7 +301,6 @@ class CommandersActTrackerTest { private val UPTIME_PERIOD = 6.seconds private val POS_PERIOD = 3.seconds private val DELTA_PERIOD = 500.milliseconds - private val TEST_TIMEOUT = 30.seconds private fun TCMediaEvent.isPeriodicEvent(): Boolean { return eventType == MediaEventType.Pos || eventType == MediaEventType.Uptime