cornichon icon indicating copy to clipboard operation
cornichon copied to clipboard

http4s ember client

Open agourlay opened this issue 5 years ago • 2 comments

context https://github.com/agourlay/cornichon/issues/391

agourlay avatar Oct 16 '20 10:10 agourlay

Two different errors are breaking the tests:

  • https://github.com/http4s/http4s/issues/3732
  • https://github.com/http4s/http4s/issues/3717

agourlay avatar Oct 16 '20 11:10 agourlay

ember 0.23.10 still failing with https://github.com/http4s/http4s/issues/4935

agourlay avatar Mar 04 '22 08:03 agourlay

I think this is what happens:

  1. Suppose SuperHeroesScenario runs first. It starts a server at port 8080.
  2. The client establishes a connection to the server, and caches that connection.
  3. The test completes successfully. The server shuts down.
  4. Now suppose the WebShopCheck runs next. It starts a server at port 8080.
  5. The client makes a request to localhost:8080. It recognizes the address, so it re-uses the cached connection.
  6. As we know, this particular connection is to the old superhero server. So it is stale, and the client gets no response. Indeed it discovers that the remote has disconnected. I.e. Remote Disconnect: Received zero bytes after sending request.
  7. The client cannot retry the error, because this was a POST request. So it may be side-effecting, and it is not safe to do so.
  8. The client raises the error to the user.

The easy fix is to run each of your tests on a different port. e.g. 8080, 8081, 8082, 8083 etc.

armanbilge avatar Feb 17 '23 21:02 armanbilge