are there specific OS, JDK, or IP stack requiremen...
# arrow
f
are there specific OS, JDK, or IP stack requirements to build Arrow? I have failures on https://github.com/arrow-kt/arrow/blob/90f3c96d8ff2f8e54c1f63c4e9b6e79f9720c277/ar[…]/adapter/either/networkhandling/NetworkEitherCallAdapterTest.kt because it expects the cause to be ConnectException , but I get SocketException :
Copy code
java.lang.AssertionError: java.net.SocketException: Software caused connection abort: recv failed is of type java.net.SocketException but expected java.net.ConnectException
s
Hey @Fiouz, Not that I am aware of. I am not super familiar with Retrofit either. Perhaps @stojan or @Lukasz Kalnik can provide some details.
l
Hey, can you please give me the specific line where the test fails?
f
Copy code
Caused 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)
Copy code
>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
Copy code
>git rev-parse HEAD
90f3c96d8ff2f8e54c1f63c4e9b6e79f9720c277
I can make the test pass if is specify the parent class of ConnectException, i.e. SocketException
s
Almost seems like this is a breaking change in the runtime of JDK 🤯
l
Thanks, I will check it
This might be some Windows specific issue
Probably a subtle inconsistency between the behavior of the JVM when server interrupts the connection. The test failing is this one:
Copy code
"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>()
  }
As the test passes for me (on a Mac) also with
SocketException
I will just create a PR which accepts this more general error type.
No need to be very specific here, it's important that the error got wrapped into a
Left
@Fiouz I created a PR which should fix the issue for you.
f
great, thank you!