Skip to content

Commit 4b81569

Browse files
committed
update 4.2
1 parent 4c93bfb commit 4b81569

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

core-kotlin-modules/core-kotlin-concurrency-3/src/test/java/com/baeldung/schedulingrepeatingtask/SchedulingRepeatingTaskUnitTest.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,17 @@ class SchedulingRepeatingTaskUnitTest {
2727

2828
@Test
2929
fun `using withTimeout`(): Unit = runBlocking {
30+
var count = 0
3031
assertThrows<TimeoutCancellationException> {
3132
withTimeout(5000.milliseconds) {
3233
while (true) {
34+
count++
3335
println("Waiting for timeout")
3436
delay(1000.milliseconds)
3537
}
3638
}
3739
}
40+
assertEquals(5, count)
3841
}
3942

4043
@Test

0 commit comments

Comments
 (0)