cornichon
cornichon copied to clipboard
http4s ember client
context https://github.com/agourlay/cornichon/issues/391
Two different errors are breaking the tests:
- https://github.com/http4s/http4s/issues/3732
- https://github.com/http4s/http4s/issues/3717
ember 0.23.10 still failing with https://github.com/http4s/http4s/issues/4935
I think this is what happens:
- Suppose
SuperHeroesScenarioruns first. It starts a server at port 8080. - The client establishes a connection to the server, and caches that connection.
- The test completes successfully. The server shuts down.
- Now suppose the
WebShopCheckruns next. It starts a server at port 8080. - The client makes a request to
localhost:8080. It recognizes the address, so it re-uses the cached connection. - 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. - The client cannot retry the error, because this was a
POSTrequest. So it may be side-effecting, and it is not safe to do so. - 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.