Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't test async: (DBConnection.OwnershipError) cannot find ownership process #20

Open
dustinfarris opened this issue Dec 17, 2023 · 1 comment

Comments

@dustinfarris
Copy link

dustinfarris commented Dec 17, 2023

testing flame calls that involve the repo get hung up on the ownership process.

edit: simplified example

defmodule MyAppTest do
  test "flame accessing the db" do
    FLAME.call(MyPool, fn -> Repo.all(MySchema) end)
  end
end

raises

** (EXIT from #PID<0.544.0>) an exception was raised:
         ** (DBConnection.OwnershipError) cannot find ownership process for #PID<0.592.0>.

             (ecto_sql 3.9.2) lib/ecto/adapters/sql.ex:910: Ecto.Adapters.SQL.raise_sql_call_error/1
             (ecto_sql 3.9.2) lib/ecto/adapters/sql.ex:828: Ecto.Adapters.SQL.execute/6
             (ecto 3.9.6) lib/ecto/repo/queryable.ex:229: Ecto.Repo.Queryable.execute/4
             (ecto 3.9.6) lib/ecto/repo/queryable.ex:19: Ecto.Repo.Queryable.all/3
             (flame 0.1.7) lib/flame/runner.ex:408: anonymous fn/3 in FLAME.Runner.remote_call/4

this does not apply when async: false

@dustinfarris dustinfarris changed the title trouble testing: (DBConnection.OwnershipError) cannot find ownership process can't test async: (DBConnection.OwnershipError) cannot find ownership process Dec 17, 2023
@josevalim
Copy link
Member

We probably need to set the $caller in the process dictionary accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants