-
Notifications
You must be signed in to change notification settings - Fork 18
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
getting :badarg
or :econnrefused
using mix testcontainers.test
#156
Comments
Will check! thanks for the report! |
i actually fixed a bug on master lately about TC elixir always trying to open a connection to Ryuk on localhost. Ill cut a release |
try with new version 1.11.7 just tested on my macOS with docker desktop and tests passes for this repo at least. But I had some weirdness with docker desktop. TC elixir seems to find docker.sock in home folder first, but then there are some permission stuff that follows from that when creating containers. Changing to check for /etc/run/docker.sock first resolved this for me. I will release this too if you struggle more. There are a lot of strategies and all are tried in order. |
btw i will try out Colima .. it looks cool |
hmm .. works with Colima with this "hack" sudo ln -s /Users/jarlah/.colima/docker.sock /var/run/docker.sock at least it runs tests in this project :) failing a couple (as expected) |
can you try with the new version @pavlenski ? |
@jarlah Pardon for the late reply I've managed to get it running with colima, linking the docker.sock worked fine with However, some test runs work completely fine, on some I get the following error:
On each run I always get the following outputs, either passing or not:
(the command executions retries 3-4 times) One pattern I've recognized is when I make changes to my test file, running the first couple of times will end with an error. After a couple of runs this worked fine afterwards without any changes. For reference, here's the simple test file: defmodule StockerApiWeb.TradeOptionsControllerTest do
use StockerApiWeb.ConnCase
# import StockerApi.Factory
alias StockerApi.Stocks.Stock
alias StockerApi.Repo
setup params do
IO.inspect(Repo.config())
{:ok, %{conn: params.conn}}
end
describe "dummy" do
test "testing dummy!", %{conn: conn} = params do
stock =
%Stock{}
|> Stock.create_changeset(%{
name: "Test2",
ticker: "TTS2",
created_at: "2013-05-18"
})
|> Repo.insert!()
stocks = Repo.all(Stock)
IO.inspect(stocks)
assert 1 == 1
end
end
end |
@jarlah Interestingly, this seems to happen only on my machine for now. I've set up a github action CI, and the tests running there always go through without connection errors.. |
I would give 1.17 with otp 25 a try. Just to check. No big hopes but worth a try. I will debug when this when i get the time 😃 havent had such big problems with this on my own machines. |
You could also try container reuse :) but its experimental |
Having trouble running
mix testcontainers.test
Getting the following error when trying to run the mix command:
after a couple of runs the error switches and I get the following as a response:
I get these responses with my colima setup as the docker runtime, failed to come even close with docker desktop
macOS - Sonoma 14.5
elixir - 1.17.3-otp-27 (tried 1.17.1 also)
docker - 27.4.0
colima - v0.8.0
anyone got an idea?
The text was updated successfully, but these errors were encountered: