Skip to content

Commit

Permalink
update to disable ChunkedLatestFlowTest in GitHub Actions due to unst…
Browse files Browse the repository at this point in the history
…able coroutine performance
  • Loading branch information
sunny-chung committed Nov 9, 2024
1 parent e88df00 commit 6316be2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ tasks.withType<Test> {
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
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -11,15 +10,14 @@ 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

class ChunkedLatestFlowTest {

@Test
fun receiveOnlyLatestValues() {
runBlocking(Executors.newSingleThreadExecutor().asCoroutineDispatcher()) {
runBlocking {
val results = Collections.synchronizedList(mutableListOf<Int>())

coroutineScope {
Expand All @@ -43,7 +41,7 @@ class ChunkedLatestFlowTest {

@Test
fun receiveValuesEmittedAtCompletion1() {
runBlocking(Executors.newSingleThreadExecutor().asCoroutineDispatcher()) {
runBlocking {
val results = Collections.synchronizedList(mutableListOf<Int>())

coroutineScope {
Expand All @@ -69,7 +67,7 @@ class ChunkedLatestFlowTest {

@Test
fun receiveValuesEmittedAtCompletion2() {
runBlocking(Executors.newSingleThreadExecutor().asCoroutineDispatcher()) {
runBlocking {
val results = Collections.synchronizedList(mutableListOf<Int>())

coroutineScope {
Expand Down Expand Up @@ -129,7 +127,7 @@ class ChunkedLatestFlowTest {

@Test
fun collectAfterCancel() {
runBlocking(Executors.newSingleThreadExecutor().asCoroutineDispatcher()) {
runBlocking {
val results = Collections.synchronizedList(mutableListOf<Int>())

coroutineScope {
Expand Down

0 comments on commit 6316be2

Please sign in to comment.