I got a question regarding tests of the Ktor `Http...
# ktor
o
I got a question regarding tests of the Ktor `HttpClient`: when testing the retry feature
HttpRequestRetry
I want my unit test to not wait in real time, but rather use a test scope with virtual time
runTest { ... }
but sadly, doing so with a
MockEngine
and this test scope, the retries still consume the complete real time it takes for it to do the repeated tries. How can I get the `HttpClient`'s
HttpRequestRetry
feature to use virtual time instead?
3
s
I've had the same problem before; the only solution I found was to make a custom
MockEngine
implementation 😞
o
I found a way to overwrite the delay function used by the HttpRequestRetry by a delay setting... But this adds code to the production code, which I think is bad... Would be better if it behaved differently when within a runTest block...
o
Please, vote for this feature: KTOR-3571