CLOVIS
04/15/2024, 10:22 AMCLOVIS
04/15/2024, 10:23 AMfun baz() {
TODO()
}
fun bar() {
baz()
}
fun foo() {
bar()
}
test("Stack trace") {
foo()
}
Stack trace:
kotlin.NotImplementedError: An operation is not implemented.
at …$1.invoke$baz(UsernameTest.kt:15)
at …$1.invoke$bar(UsernameTest.kt:19)
at …$1.invoke$foo(UsernameTest.kt:23)
at …$1.access$invoke$foo(UsernameTest.kt:12)
CLOVIS
04/15/2024, 10:25 AMsuspend
and delay
:
suspend fun baz() {
TODO()
}
suspend fun bar() {
delay(100)
baz()
}
suspend fun foo() {
bar()
}
test("Stack trace") {
foo()
}
Stacktrace:
kotlin.NotImplementedError: An operation is not implemented.
at …$1.invoke$baz(UsernameTest.kt:15)
at …$1.invoke$bar(UsernameTest.kt:20)
at …$1.access$invoke$bar(UsernameTest.kt:12)
As you can see, foo
and everything before it have completely disappeared.
I'm not saying it's wrong, after all, foo
is indeed not in the call stack, but this is very confusing in complex examples.
The problem is that the test
call that initiated this entire example is gone from the stacktrace. If this example was more complex, I would have no way to know what actually called it at the start.CLOVIS
04/15/2024, 10:29 AM-ea
to enable stacktrace recovery:
An operation is not implemented.kotlin.NotImplementedError: An operation is not implemented.
at …$1.invoke$baz(UsernameTest.kt:15)
at …$1.invoke$bar(UsernameTest.kt:20)
at …$1.access$invoke$bar(UsernameTest.kt:12)
at …$1$invoke$bar$1.invokeSuspend(UsernameTest.kt)
at _COROUTINE._BOUNDARY._(CoroutineDebugging.kt:42)
<…>
Caused by: kotlin.NotImplementedError: An operation is not implemented.
at …$1.invoke$baz(UsernameTest.kt:15)
at …$1.invoke$bar(UsernameTest.kt:20)
at …$1.access$invoke$bar(UsernameTest.kt:12)
This is a bit better (it actually recovered the internals of the test framework in the <…>
section) however foo
and the test itself are still missing.ephemient
04/15/2024, 11:05 AMephemient
04/15/2024, 11:06 AMCLOVIS
04/15/2024, 11:24 AMchristophsturm
04/16/2024, 9:42 PMCLOVIS
04/17/2024, 7:35 AM