Closed michivi closed 1 year ago
Sorry, the code was only working if the test program is not in a container. Let me just fix this so it works both in a container, and on the host.
Ok, the waitForHttp
function now works within and outside of a Docker network:
This PR adds the
waitForHttp
which waits until the given container port returns one of the acceptable status codes.This is required as in some cases,
waitUntilMappedPortReachable
is not enough: the containerized Web container is listening to requests but is actually still not ready to take them.Some notes regarding this implementation:
GET
requests. It may be interesting to be more flexible on the request in the future.Manager
is created for each port to be tested, which may be kind of wasteful.HttpException
is not traced as-is as there is no instance forEq HttpException
, andTrace
requires it. AString
is used instead. Not ideal, but might be enough for tests? RemovingEq
forTrace
would be a breaking change.