Thank you for writing about it Piotr!
Great analysis of the ownership modes in the blog post. The only note maybe worth adding is that the :shared mode is exactly how it worked with Ecto 1.x.
I hope that once folks become a bit more comfortable with manual and shared mode, it will be easier to just start with manual mode and setup shared when you need it. In fact, we should probably ship with this setup for Phoenix:
setup config do
:ok = Ecto.Adapters.SQL.Sandbox.checkout(Repo)
if !config[:async] do
:ok = Ecto.Adapters.SQL.Sandbox.mode(Repo, {:shared, self()})
end
:ok
end
This way we run in shared mode by default and folks will have problems only if they are trying to make their tests async in the first place.