Hi. Is there any way I could mock long running req...
# ktor
r
Hi. Is there any way I could mock long running request using MockEngine? Writing a test where I want to test how my code performs at cancellation.
e
Hey @rsetkus, could you add
delay
call to handler?
r
Hi @e5l. You mean something like this?
Copy code
TEST_DELAY_URL -> {
    delay(2000)
    respondOk()
}
^ this is inside
addHandler
,
when
clause
e
Yep
r
I guess it worked out. I am getting
java.util.concurrent.CancellationException: StandaloneCoroutine was cancelled
which is expected result to get when coroutine is at suspension point.