From 6316be226e26d8f1e76c52f013ca22c4ade1f832 Mon Sep 17 00:00:00 2001 From: Sunny Chung Date: Sat, 9 Nov 2024 13:49:29 +0800 Subject: [PATCH] update to disable ChunkedLatestFlowTest in GitHub Actions due to unstable coroutine performance --- build.gradle.kts | 1 + .../hellohttp/test/util/ChunkedLatestFlowTest.kt | 10 ++++------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 20331655..121a7ce8 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -166,6 +166,7 @@ tasks.withType { if (project.hasProperty("isCI") && project.property("isCI").toString().toBoolean()) { filter { excludeTestsMatching("com.sunnychung.application.multiplatform.hellohttp.test.bigtext.**") + excludeTestsMatching("com.sunnychung.**.ChunkedLatestFlowTest") // The latencies of `delay()` are unstable on GitHub macOS runners } } } diff --git a/src/jvmTest/kotlin/com/sunnychung/application/multiplatform/hellohttp/test/util/ChunkedLatestFlowTest.kt b/src/jvmTest/kotlin/com/sunnychung/application/multiplatform/hellohttp/test/util/ChunkedLatestFlowTest.kt index e295a405..186158f8 100644 --- a/src/jvmTest/kotlin/com/sunnychung/application/multiplatform/hellohttp/test/util/ChunkedLatestFlowTest.kt +++ b/src/jvmTest/kotlin/com/sunnychung/application/multiplatform/hellohttp/test/util/ChunkedLatestFlowTest.kt @@ -2,7 +2,6 @@ package com.sunnychung.application.multiplatform.hellohttp.test.util import com.sunnychung.application.multiplatform.hellohttp.util.chunkedLatest import com.sunnychung.lib.multiplatform.kdatetime.extension.milliseconds -import kotlinx.coroutines.asCoroutineDispatcher import kotlinx.coroutines.coroutineScope import kotlinx.coroutines.delay import kotlinx.coroutines.flow.flow @@ -11,7 +10,6 @@ import kotlinx.coroutines.flow.onEach import kotlinx.coroutines.launch import kotlinx.coroutines.runBlocking import java.util.Collections -import java.util.concurrent.Executors import kotlin.test.Test import kotlin.test.assertEquals @@ -19,7 +17,7 @@ class ChunkedLatestFlowTest { @Test fun receiveOnlyLatestValues() { - runBlocking(Executors.newSingleThreadExecutor().asCoroutineDispatcher()) { + runBlocking { val results = Collections.synchronizedList(mutableListOf()) coroutineScope { @@ -43,7 +41,7 @@ class ChunkedLatestFlowTest { @Test fun receiveValuesEmittedAtCompletion1() { - runBlocking(Executors.newSingleThreadExecutor().asCoroutineDispatcher()) { + runBlocking { val results = Collections.synchronizedList(mutableListOf()) coroutineScope { @@ -69,7 +67,7 @@ class ChunkedLatestFlowTest { @Test fun receiveValuesEmittedAtCompletion2() { - runBlocking(Executors.newSingleThreadExecutor().asCoroutineDispatcher()) { + runBlocking { val results = Collections.synchronizedList(mutableListOf()) coroutineScope { @@ -129,7 +127,7 @@ class ChunkedLatestFlowTest { @Test fun collectAfterCancel() { - runBlocking(Executors.newSingleThreadExecutor().asCoroutineDispatcher()) { + runBlocking { val results = Collections.synchronizedList(mutableListOf()) coroutineScope {