Closed dmorneau closed 5 years ago
Hi, can you please provide a sample application that reproduces the error? Thank you.
This should do it:
git clone git@github.com:dmorneau/repro-ecto-119.git
cd repro-ecto-119
mix deps.get
mix test
MIX_ENV=test mix ecto.rollback; mix test
The last command almost always reproduces it for me. The diff versus a new Phoenix app is this commit https://github.com/dmorneau/repro-ecto-119/commit/5074ed5cf6d13ab1218f8ccb3616193b5d5d9e7b.
This error is most likely caused by the Ecto OTP application not starting. Do you have it correctly configured in mix.exs
? Are you running the tests with the --no-start
flag?
Environment
Current behavior
In an older application that has a
test_helper.exs
file like this one (Phoenix 1.1.x generator):The first time tests are run after a new migration is added, the run fails with this stacktrace:
Expected behavior
Ideally the repo should still be up and usable after the Ecto migration runs, or there could be a more helpful error message. Since the migration is silent, this showed up as flaky tests that were quite hard to track down.