Brent Beardsley
08/25/2022, 4:29 PMOkHttp
ktor client in a testApplication
block? We're seeing channel closed issues with the default client and was trying to work around it.Aleksei Tirman [JB]
08/25/2022, 4:31 PMtestApplication
in more detail?Brent Beardsley
08/25/2022, 7:27 PMkotlinx.coroutines.channels.ClosedReceiveChannelException: Channel was closed
at kotlinx.coroutines.channels.Closed.getReceiveException(AbstractChannel.kt:1108)
at kotlinx.coroutines.channels.AbstractChannel$ReceiveElement.resumeReceiveClosed(AbstractChannel.kt:913)
at kotlinx.coroutines.channels.AbstractSendChannel.helpClose(AbstractChannel.kt:342)
at kotlinx.coroutines.channels.AbstractSendChannel.close(AbstractChannel.kt:271)
at kotlinx.coroutines.channels.ChannelCoroutine.close(ChannelCoroutine.kt)
at kotlinx.coroutines.channels.SendChannel$DefaultImpls.close$default(Channel.kt:93)
at io.ktor.network.tls.TLSClientHandshake$input$1.invokeSuspend(TLSClientHandshake.kt:91)
at (Coroutine boundary.()
at io.ktor.client.engine.HttpClientEngine$DefaultImpls.executeWithinCallContext(HttpClientEngine.kt:100)
at io.ktor.client.engine.HttpClientEngine$install$1.invokeSuspend(HttpClientEngine.kt:70)
at io.ktor.client.plugins.logging.Logging$setupRequestLogging$1.invokeSuspend(Logging.kt:74)
at io.ktor.client.plugins.HttpSend$DefaultSender.execute(HttpSend.kt:138)
at io.ktor.client.plugins.HttpCallValidator$Companion$install$3.invokeSuspend(HttpCallValidator.kt:147)
at io.ktor.client.plugins.HttpSend$Plugin$install$1.invokeSuspend(HttpSend.kt:104)
at io.ktor.client.engine.HttpClientEngine$DefaultImpls.executeWithinCallContext(HttpClientEngine.kt:100)
at io.ktor.client.engine.HttpClientEngine$install$1.invokeSuspend(HttpClientEngine.kt:70)
at io.ktor.client.plugins.logging.Logging$setupRequestLogging$1.invokeSuspend(Logging.kt:74)
at io.ktor.client.plugins.HttpSend$DefaultSender.execute(HttpSend.kt:138)
Aleksei Tirman [JB]
08/26/2022, 6:07 AMtestApplication
doesn’t do network requests. Could you please describe how do you use the testApplication
if you use it at all?