-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make it possible to customize 'ryuk' reaper config #50
Comments
I've looked at the code a bit more, and looks like the right way to solve the problem is to resolve this TODO |
So the actual problem is that |
Hmm, judging by |
…ution In some cases, 'localhost' might be resolved to IPv6 '::1', while 'containerPort' will grab IPv4 host IP port mapping by default, when Docker maps different ports for host's IPv4 and IPv6 addresses, this might cause timeout errors. To solve this issue, the Docker host is resolved from 'localhost' at container creation time, host IP protocol version is later used to deduce the corresponding port in 'containerPort' function. Additionally, helper 'containerAddress', as well as 'TraceOpenSocket' and 'TraceHttpCall' now operate 'IP' addresses instead of plain 'Text' domains. This should be safe since we only actually consider domains within some Docker network or 'localhost' at the moment.
…ution In some cases, 'localhost' might be resolved to IPv6 '::1', while 'containerPort' will grab IPv4 host IP port mapping by default, when Docker maps different ports for host's IPv4 and IPv6 addresses, this might cause timeout errors. To solve this issue, the Docker host is resolved from 'localhost' at container creation time, host IP protocol version is later used to deduce the corresponding port in 'containerPort' function. Additionally, helper 'containerAddress', as well as 'TraceOpenSocket' and 'TraceHttpCall' now operate 'IP' addresses instead of plain 'Text' domains. This should be safe since we only actually consider domains within some Docker network or 'localhost' at the moment.
…ution In some cases, 'localhost' might be resolved to IPv6 '::1', while 'containerPort' will grab IPv4 host IP port mapping by default, when Docker maps different ports for host's IPv4 and IPv6 addresses, this might cause timeout errors. To solve this issue, the Docker host is resolved from 'localhost' at container creation time, host IP protocol version is later used to deduce the corresponding port in 'containerPort' function. Additionally, helper 'containerAddress', as well as 'TraceOpenSocket' and 'TraceHttpCall' now operate 'IP' addresses instead of plain 'Text' domains. This should be safe since we only actually consider domains within some Docker network or 'localhost' at the moment.
…ific host IP The main motivation for this change is the fact that by default Docker will map both ipv4 and ipv6 addresses and in some cases Docker will map them to different host ports causing 'testcontainer-hs' testsuite to fail while waiting for container to be available at specific port. So this commit introduces an ability to explicitly host IP and port via 'setExpose' using the same syntax as 'docker run --publish/expose' option (see https://docs.docker.com/reference/cli/docker/container/run/#publish). A few more cursed instances are added. Mostly for the sake of backward compatibility with old 'setExpose' interface:)
…ific host IP The main motivation for this change is the fact that by default Docker will map both ipv4 and ipv6 addresses and in some cases Docker will map them to different host ports causing 'testcontainer-hs' testsuite to fail while waiting for container to be available at specific port. So this commit introduces an ability to explicitly host IP and port via 'setExpose' using the same syntax as 'docker run --publish/expose' option (see https://docs.docker.com/reference/cli/docker/container/run/#publish). A few more cursed instances are added. Mostly for the sake of backward compatibility with old 'setExpose' interface:)
I stumbled upon moby/moby#42442 which periodically breaks tests that are based on
testcontainers-hs
.One way to workaround this issue is to disable IPv6 altogether on the machine that runs tests, but IMO this doesn't sound like a nice solution since test suite results consistency will depend on local setup.
Instead, it'd be better to run the
ryuk
container with--publish 127.0.0.1::8080
instead of--publish 8080
, however, this is not viable with the current interface provided bytestcontainers-hs
.What I propose to do is to add a version of
withContainers
function that will allow running theTestContainer
action either with customConfig
or with custom Reaper container.The text was updated successfully, but these errors were encountered: