[debugger] Fixed the flaky withTimeout test: removed the loop.

IDEA-372151

GitOrigin-RevId: 1dbb4a8fd8ef16a7feaea8f4259167d0a30895d7
This commit is contained in:
Maria Sokolova
2025-07-01 13:49:14 +00:00
committed by intellij-monorepo-bot
parent 685f9b6c24
commit f42f4bc465
2 changed files with 15 additions and 10 deletions
@@ -6,16 +6,19 @@ import kotlinx.coroutines.*
fun main() {
runBlocking {
repeat(10) {
launch {
withTimeout(10) { //todo withTimeout frame is skipped
delay(1)
//Breakpoint!
println()
delay(1)
launch {
withContext(Dispatchers.Default) {
val res = withTimeout(100) {
try {
//Breakpoint!
delay(1)
5
} catch (e: CancellationException) {
-1
}
}
assert(res == 5)
}
}
}
println()
}
@@ -3,12 +3,14 @@ Run Java
Connected to the target VM
withTimeout.kt:14
vvv stack trace vvv
invokeSuspend:14, WithTimeoutKt$main$1$1$1$1
invokeSuspend:14, WithTimeoutKt$main$1$1$1$res$1
invokeSuspend:11, WithTimeoutKt$main$1$1$1
invokeSuspend:10, WithTimeoutKt$main$1$1
invoke:-1, WithTimeoutKt$main$1$1$1$res$1
<hidden frames>
-- Async stack trace --
<hidden frames>
invokeSuspend:10, WithTimeoutKt$main$1
invokeSuspend:9, WithTimeoutKt$main$1
<hidden frames>
-- Async stack trace --
<hidden frames>