Skip to content

Commit ebc05b1

Browse files
committed
Add tests for ownership through callers
1 parent 29e6759 commit ebc05b1

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

integration_test/ownership/manager_test.exs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,23 @@ defmodule ManagerTest do
338338
|> Task.await()
339339
end
340340

341+
@tag :requires_callers
342+
test "performs callers checkout on manual mode through allowance" do
343+
{:ok, pool, opts} = start_pool()
344+
assert Ownership.ownership_mode(pool, :manual, []) == :ok
345+
346+
:ok = Ownership.ownership_checkout(pool, [])
347+
assert_checked_out(pool, opts)
348+
parent = self()
349+
350+
async_no_callers(fn ->
351+
assert Ownership.ownership_allow(pool, parent, self(), []) == :ok
352+
assert_checked_out(pool, opts)
353+
Task.async(fn -> assert_checked_out(pool, opts) end) |> Task.await()
354+
end)
355+
|> Task.await()
356+
end
357+
341358
@tag :requires_callers
342359
test "does not perform callers checkout on auto mode" do
343360
{:ok, agent} =

0 commit comments

Comments
 (0)