File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -45,7 +45,9 @@ defmodule Ecto.Adapters.SQL.Sandbox do
4545
4646 setup do
4747 # Explicitly get a connection before each test
48- :ok = Ecto.Adapters.SQL.Sandbox.checkout(Repo)
48+ pid = Ecto.Adapters.SQL.Sandbox.start_owner!(Repo)
49+ on_exit(fn -> Ecto.Adapters.SQL.Sandbox.stop_owner(pid) end)
50+ :ok
4951 end
5052
5153 test "create post" do
@@ -102,6 +104,9 @@ defmodule Ecto.Adapters.SQL.Sandbox do
102104 the parent's connection (i.e. the test process' connection) to
103105 the task.
104106
107+ Besides calling `allow/3` allowance can also be provided to processes
108+ via [Caller Tracking](`m:Task#module-ancestor-and-caller-tracking`).
109+
105110 Because allowances use an explicit mechanism, their advantage
106111 is that you can still run your tests in async mode. The downside
107112 is that you need to explicitly control and allow every single
@@ -148,7 +153,7 @@ defmodule Ecto.Adapters.SQL.Sandbox do
148153
149154 There are two mechanisms for explicit ownerships:
150155
151- * Using allowances - requires explicit allowances via `allow/3` .
156+ * Using allowances - requires explicit allowances.
152157 Tests may run concurrently.
153158
154159 * Using shared mode - does not require explicit allowances.
You can’t perform that action at this time.
0 commit comments