Merge "Lower the intensity of Expect bash test due to timeout" into androidx-main
diff --git a/kruth/kruth/src/jvmTest/kotlin/androidx/kruth/ExpectTest.kt b/kruth/kruth/src/jvmTest/kotlin/androidx/kruth/ExpectTest.kt
index 59e6cf8..4751c68 100644
--- a/kruth/kruth/src/jvmTest/kotlin/androidx/kruth/ExpectTest.kt
+++ b/kruth/kruth/src/jvmTest/kotlin/androidx/kruth/ExpectTest.kt
@@ -25,6 +25,7 @@
import kotlin.test.assertFailsWith
import kotlinx.coroutines.Deferred
import kotlinx.coroutines.async
+import kotlinx.coroutines.awaitAll
import kotlinx.coroutines.test.runTest
import org.junit.Rule
import org.junit.rules.ExpectedException
@@ -153,11 +154,11 @@
@Test
fun bash() = runTest {
val results = mutableListOf<Deferred<*>>()
- repeat(1000) {
+ repeat(500) {
results.add(async { expect.that(3).isEqualTo(4) })
}
- results.forEach { it.await() }
- thrown.expectMessage("1000 expectations failed:")
+ results.awaitAll()
+ thrown.expectMessage("500 expectations failed:")
}
@Test