I’m trying to figure out how to run a custom migration in a test, while using the ecto sandbox.
I have a test file where I do Ecto.Migrator.up in the setup and Ecto.Migrator.down in the on_exit.
This is how far I’ve gotten already:
When I ignore the sandbox and don’t checkout the sandbox in my test and run the test in isolation, it works fine.
When I run the test in the test suite though, I get errors that some PID is still using the connection and OwnershipErrors.
I’ve played with checkout and mode shared but nothing seems to fix the issue.
Does anyone know a possible fix?
My only solution so far is to run this test file completely separate from the rest of the suite.




















