** (EXIT from #PID<0.421.0>) an exception was raised:
** (RuntimeError) cannot find ownership process for #PID<0.534.0>.
When using ownership, you must manage connections in one
of the three ways:
* By explicitly checking out a connection
* By explicitly allowing a spawned process
* By running the pool in shared mode
The first two options require every new process to explicitly
check a connection out or be allowed by calling checkout or
allow respectively.
The third option requires a {:shared, pid} mode to be set.
If using shared mode in tests, make sure your tests are not
async.
If you are reading this error, it means you have not done one
of the steps above or that the owner process has crashed.
DbConnection raises a great error that explains the issue and possible solutions to it. But there's no pointer to the code I should use to fix it. We should capture the error in the SQL adapter and a pointer to Ecto.Adapters.SQL.Sandbox.
Initial work done here: https://github.com/fishcakez/db_connection/commit/401d0744ce3240e2539262b8b7d3123ae1ca6bfa
In a Phoenix app, this error happens if you try to run ecto queries in a test module with use ExUnit.Case instead of the appropriate use <YourApp>.ModelCase
@kenabe It's now <YourApp>.DataCase.
I didn't know what's causing the problem, but when i came across your comment, I realized I forgot to change ExUnit.Case to <MyApp>.DataCase. :100:
Most helpful comment
In a Phoenix app, this error happens if you try to run ecto queries in a test module with
use ExUnit.Caseinstead of the appropriateuse <YourApp>.ModelCase