Fiouz
09/13/2022, 5:53 AMCopy codejava.lang.AssertionError: java.net.SocketException: Software caused connection abort: recv failed is of type java.net.SocketException but expected java.net.ConnectException
simon.vergauwen
09/13/2022, 6:48 AMLukasz Kalnik
09/13/2022, 7:07 AMFiouz
09/13/2022, 7:25 AMCaused by: java.lang.AssertionError: java.net.SocketException: Software caused connection abort: recv failed is of type java.net.SocketException but expected java.net.ConnectException
at arrow.retrofit.adapter.either.networkhandling.NetworkEitherCallAdapterTestKt$networkEitherCallAdapterTests$1$7.invokeSuspend(NetworkEitherCallAdapterTest.kt:159)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)
>gradlew --version
Picked up JAVA_TOOL_OPTIONS: "-XX:+UsePerfData" "-Duser.language=en" "-Duser.country=US" "-Duser.timezone=UTC" "-Dfile.encoding=UTF-8"
------------------------------------------------------------
Gradle 7.5
------------------------------------------------------------
Build time: 2022-07-14 12:48:15 UTC
Revision: c7db7b958189ad2b0c1472b6fe663e6d654a5103
Kotlin: 1.6.21
Groovy: 3.0.10
Ant: Apache Ant(TM) version 1.10.11 compiled on July 10 2021
JVM: 11.0.14.1 (Eclipse Adoptium 11.0.14.1+1)
OS: Windows 10 10.0 amd64
>git rev-parse HEAD
90f3c96d8ff2f8e54c1f63c4e9b6e79f9720c277
Fiouz
09/13/2022, 7:26 AMsimon.vergauwen
09/13/2022, 7:27 AMLukasz Kalnik
09/13/2022, 7:31 AMLukasz Kalnik
09/14/2022, 5:40 AMLukasz Kalnik
09/14/2022, 5:42 AM"should return IOError when server disconnects" {
server!!.enqueue(MockResponse().apply { socketPolicy = SocketPolicy.DISCONNECT_AT_START })
val body = service!!.getEither()
body.shouldBeInstanceOf<Left<*>>()
.value.shouldBeInstanceOf<IOError>()
.cause.shouldBeInstanceOf<ConnectException>()
}
Lukasz Kalnik
09/14/2022, 6:18 AMSocketException
I will just create a PR which accepts this more general error type.Lukasz Kalnik
09/14/2022, 6:19 AMLeft
Lukasz Kalnik
09/14/2022, 3:55 PMLukasz Kalnik
09/14/2022, 3:55 PMFiouz
09/15/2022, 2:39 AM