Skip to content

Commit

Permalink
keep ryuk alive
Browse files Browse the repository at this point in the history
  • Loading branch information
jarlah committed Oct 13, 2023
1 parent add935e commit c5cf36f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions lib/reaper.ex
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ defmodule TestcontainersElixir.Reaper do
{:ok, %Model.ContainerInspectResponse{} = container_info} <-
Api.Container.container_inspect(connection, container_id),
container = Container.of(container_info),
{:ok, socket} <- create_ryuk_socket(container) do
{:ok, socket} <- create_ryuk_socket(container),
:ok <- register_filter(socket, {"id", "keep_ryuk_alive"}) do
{:ok, socket}
end
end
Expand Down Expand Up @@ -60,7 +61,7 @@ defmodule TestcontainersElixir.Reaper do
# FIXME this will surely not work for all use cases
Binds: ["/var/run/docker.sock:/var/run/docker.sock:rw"]
},
Env: ["RYUK_PORT=#{@ryuk_port}"]
Env: ["RYUK_PORT=#{@ryuk_port}", "RYUK_CONNECTION_TIMEOUT=120s"]
})
end

Expand Down
2 changes: 1 addition & 1 deletion test/simple_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ defmodule SimpleTest do
{:ok, container} = container(image: "nginx:latest", port: 80)

port = Container.mapped_port(container, 80)
PortChecker.wait_for_port("localhost", port, 5000)
{:ok, :port_is_open} = PortChecker.wait_for_port("localhost", port, 5000)

{:ok, 200, _headers, body_ref} = :hackney.get("http://localhost:#{port}")
{:ok, body} = :hackney.body(body_ref)
Expand Down

0 comments on commit c5cf36f

Please sign in to comment.