Skip to content

Commit 33af42c

Browse files
authored
Fix Flaky tests (#226)
1 parent 65e16f4 commit 33af42c

File tree

8 files changed

+574
-562
lines changed

8 files changed

+574
-562
lines changed

arrow-libs/fx/arrow-fx-coroutines/src/test/kotlin/arrow/fx/coroutines/ArrowFxSpec.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import kotlin.math.abs
2525
* So for `0..10` it will generate at most a `Stream` with `10` `Chunk`s of `10` elements.
2626
*/
2727
abstract class StreamSpec(
28-
iterations: Int = 100,
28+
iterations: Int = 350,
2929
val depth: IntRange = 0..100,
3030
spec: StreamSpec.() -> Unit = {}
3131
) : ArrowFxSpec(iterations) {
@@ -36,7 +36,7 @@ abstract class StreamSpec(
3636
range: IntRange = depth
3737
): Arb<Pull<O, R>> =
3838
Arb.choice<Pull<O, R>>(
39-
Arb.bind(Arb.stream(arbO), arbR) { s, r ->
39+
Arb.bind(Arb.stream(arbO, range), arbR) { s, r ->
4040
s.asPull().map { r }
4141
},
4242
arbR.map { Pull.just(it) } as Arb<Pull<O, R>>,
@@ -69,7 +69,7 @@ abstract class StreamSpec(
6969
* Simple overwritten Kotest FreeSpec to reduce stress on tests.
7070
*/
7171
abstract class ArrowFxSpec(
72-
private val iterations: Int = 100,
72+
private val iterations: Int = 350,
7373
spec: ArrowFxSpec.() -> Unit = {}
7474
) : FreeSpec() {
7575

arrow-libs/fx/arrow-fx-coroutines/src/test/kotlin/arrow/fx/coroutines/BracketCaseTest.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class BracketCaseTest : ArrowFxSpec(spec = {
2121

2222
n shouldBe null // timed-out so should be null
2323
require((end - start) >= b) {
24-
"Should've taken longer than $b milliseconds, but took ${start - end}ms"
24+
"Should've taken longer than $b milliseconds, but took ${end - start}ms. (start=$start, end=$end)"
2525
}
2626
}
2727
}

0 commit comments

Comments
 (0)