We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3865ff9 commit 65b457cCopy full SHA for 65b457c
lib/ecto/adapters/sql/sandbox.ex
@@ -45,7 +45,9 @@ defmodule Ecto.Adapters.SQL.Sandbox do
45
46
setup do
47
# Explicitly get a connection before each test
48
- :ok = Ecto.Adapters.SQL.Sandbox.checkout(Repo)
+ pid = Ecto.Adapters.SQL.Sandbox.start_owner!(Repo)
49
+ on_exit(fn -> Ecto.Adapters.SQL.Sandbox.stop_owner(pid) end)
50
+ :ok
51
end
52
53
test "create post" do
@@ -54,10 +56,6 @@ defmodule Ecto.Adapters.SQL.Sandbox do
54
56
55
57
58
- If you run into issues with processes accessing your db after tests
- complete – e.g. ones stopped in `on_exit` callbacks – consider using
59
- `start_owner!/1` over `checkout/1`.
60
-
61
## Collaborating processes
62
63
The example above is straight-forward because we have only
0 commit comments