I am trying to set up an app under umbrella that will handle the business logic. It uses Ecto for interacting with the database. I’m having problems with setting up SQL.Sandbox for testing. Whenever I run test, I get this error:
$ MIX_ENV=test mix test
** (exit) exited in: GenServer.call(Domain.Repo.Pool, :checkin, 5000)
** (EXIT) no process
(elixir) lib/gen_server.ex:596: GenServer.call/3
lib/ecto/adapters/sql/sandbox.ex:422: Ecto.Adapters.SQL.Sandbox.mode/2
(elixir) lib/code.ex:363: Code.require_file/2
(elixir) lib/enum.ex:651: Enum."-each/2-lists^foreach/1-0-"/2
(elixir) lib/enum.ex:651: Enum.each/2
My config.exs looks like this:
use Mix.Config
config :domain,
ecto_repos: [Domain.Repo]
config :domain, Domain.Repo,
adapter: Ecto.Adapters.Postgres,
pool: Ecto.Adapters.SQL.Sandbox,
username: "postgres",
password: "postgres",
database: "app_test"
My test_helper.exs is:
ExUnit.start()
Ecto.Adapters.SQL.Sandbox.mode(Domain.Repo, :manual)