Reduce the delay used for Coroutines in tests

Closes gh-30731
This commit is contained in:
Sébastien Deleuze
2023-06-23 14:17:38 +02:00
parent 81f1edbaf2
commit d3a249e34d
6 changed files with 35 additions and 35 deletions

View File

@@ -34,7 +34,7 @@ class KotlinCoroutinesUtilsTests {
fun deferredToMono() {
runBlocking {
val deferred: Deferred<String> = async(Dispatchers.IO) {
delay(10)
delay(1)
"foo"
}
val mono = CoroutinesUtils.deferredToMono(deferred)
@@ -122,12 +122,12 @@ class KotlinCoroutinesUtilsTests {
}
suspend fun suspendingFunction(value: String): String {
delay(10)
delay(1)
return value
}
suspend fun suspendingFunctionWithFlow(): Flow<String> {
delay(10)
delay(1)
return flowOf("foo", "bar")
}
@@ -136,7 +136,7 @@ class KotlinCoroutinesUtilsTests {
}
suspend fun suspendingFunctionWithContext(value: String): String {
delay(10)
delay(1)
Assertions.assertThat(coroutineContext[CoroutineName]?.name).isEqualTo("name")
return value
}