Skip to content

Handling http-test-helper failure #8796

Open
@mwu-tow

Description

@mwu-tow

Consider this failed run: https://github.com/enso-org/enso/actions/runs/7542644571/job/20531928028

The eventual error that it ends up is:

- [FAILED] fetching csv [22ms]
    Reason: An unexpected dataflow error ((Request_Error.Error 'java.net.ConnectException' Nothing)) has been matched (at C:\runner\_work\enso\enso\test\Table_Tests\src\IO\Fetch_Spec.enso:39:13-31).

(line 6447)

However, the actual error is that http-test-helper failed to setup because the port is already being used:

[error] java.net.BindException: Address already in use: bind
[error] 	at java.base/sun.nio.ch.Net.bind0(Native Method)
[error] 	at java.base/sun.nio.ch.Net.bind(Net.java:565)
[error] 	at java.base/sun.nio.ch.ServerSocketChannelImpl.netBind(ServerSocketChannelImpl.java:344)
[error] 	at java.base/sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:301)
[error] 	at java.base/sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:89)
[error] 	at jdk.httpserver/sun.net.httpserver.ServerImpl.<init>(ServerImpl.java:145)
[error] 	at jdk.httpserver/sun.net.httpserver.HttpsServerImpl.<init>(HttpsServerImpl.java:50)
[error] 	at jdk.httpserver/sun.net.httpserver.DefaultHttpServerProvider.createHttpsServer(DefaultHttpServerProvider.java:39)
[error] 	at jdk.httpserver/com.sun.net.httpserver.HttpsServer.create(HttpsServer.java:95)
[error] 	at org.enso.shttp.HybridHTTPServer.<init>(HybridHTTPServer.java:31)
[error] 	at org.enso.shttp.HTTPTestHelperServer.main(HTTPTestHelperServer.java:30)
[success] Total time: 2 s, completed Jan 16, 2024, 3:42:39?PM

(line 4622)


Now, the run fails because http-test-helper failed to start. However, this error is ignored, and the run goes on only to fail much later, when table IO operations are tested. This makes problem harder to debug, wastes CI time and looks deceivingly similar to external networking failures that happen from time to time.

The build script should be able to fail as soon as the http-test-helper fails.

Thus, we either need to:

  1. Change sbt "http-test-helper/run localhost 49156" command fail (exit process with error code) if the server fails to start;
  2. Introduce a new command (or additional flag that customizes behavior) that does the above, if the previous one for some reason is not desired;
  3. Make build-script parse the output from http-test-helper and fail once the error message is printed.

I find 3) ugly and fragile, though simple to implement. I'd prefer to see a solution on the sbt side.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions