Skip to content

Commit 060f93c

Browse files
committed
More stable WithTimeoutOrNullTest.testOuterTimeoutTest (under load)
1 parent 6f150ed commit 060f93c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

kotlinx-coroutines-core/src/test/kotlin/kotlinx/coroutines/experimental/WithTimeoutOrNullTest.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,9 @@ class WithTimeoutOrNullTest : TestBase() {
136136
}
137137
}
138138
assertThat(result, IsNull())
139-
assertThat(counter, IsEqual(2))
139+
// under load counter may be equal to 1, so the check is lenient here
140+
println("Executed: $counter times")
141+
check(counter in 1..2)
140142
}
141143

142144
@Test

0 commit comments

Comments
 (0)