Skip to content

Commit

Permalink
try to fix ChunkedLatestFlowTest in some runner where delay() was n…
Browse files Browse the repository at this point in the history
…ot accurate
  • Loading branch information
sunny-chung committed Nov 9, 2024
1 parent 17b5ff3 commit 10ded51
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ 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.Dispatchers
import kotlinx.coroutines.coroutineScope
import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.flow
Expand All @@ -17,7 +18,7 @@ class ChunkedLatestFlowTest {

@Test
fun receiveOnlyLatestValues() {
runBlocking {
runBlocking(Dispatchers.IO) {
val results = Collections.synchronizedList(mutableListOf<Int>())

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

@Test
fun receiveValuesEmittedAtCompletion1() {
runBlocking {
runBlocking(Dispatchers.IO) {
val results = Collections.synchronizedList(mutableListOf<Int>())

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

@Test
fun receiveValuesEmittedAtCompletion2() {
runBlocking {
runBlocking(Dispatchers.IO) {
val results = Collections.synchronizedList(mutableListOf<Int>())

coroutineScope {
Expand Down

0 comments on commit 10ded51

Please sign in to comment.