StreamVault is a TV-first free IPTV player for Android TV built with Kotlin, Jetpack Compose, Room, Hilt, and Media3.
Kotlin iptv-player
Fix Xtream timeout cancellation test
David Nashash6dfbc896c0f5
diff --git a/data/src/test/java/com/streamvault/data/remote/xtream/OkHttpXtreamApiServiceTest.kt b/data/src/test/java/com/streamvault/data/remote/xtream/OkHttpXtreamApiServiceTest.ktindex 0728112f..e06d3738 100644--- a/data/src/test/java/com/streamvault/data/remote/xtream/OkHttpXtreamApiServiceTest.kt+++ b/data/src/test/java/com/streamvault/data/remote/xtream/OkHttpXtreamApiServiceTest.kt@@ -8,7 +8,9 @@ import java.io.IOExceptionimport java.net.SocketTimeoutExceptionimport java.util.concurrent.atomic.AtomicIntegerimport kotlinx.coroutines.CompletableDeferred+import kotlinx.coroutines.Dispatchersimport kotlinx.coroutines.withTimeout+import kotlinx.coroutines.withContextimport kotlinx.coroutines.test.runTestimport kotlinx.serialization.json.Jsonimport okhttp3.Interceptor@@ -160,8 +162,10 @@ class OkHttpXtreamApiServiceTest {}.exceptionOrNull()assertThat(failure).isNotNull()- withTimeout(500) {- cancellationObserved.await()+ withContext(Dispatchers.Default.limitedParallelism(1)) {+ withTimeout(500) {+ cancellationObserved.await()+ }}}