Recent changes to Phoenix testing?

This seems to be a bit random. I’m getting issues with Elixir testing. The culprit line is this:

:ok = Ecto.Adapters.SQL.Sandbox.checkout(Draft.Repo)

It used to work and has suddenly stopped working. Not even sure what I did to get it to randomly stop working. But the error is:

** (MatchError) no match of right hand side value: {:already, :owner}

What checkout/1 recently changed to return something different?

1 Like

The error suggests you’re calling the checkout function twice in a single process.

1 Like

I’m getting a same problem.

What’s the error message meaning for? Is the DB connection not checked in automatically? Currently :auto mode is used in my app instead.

I am getting this error too with absinthe 1.4 and phoenix 1.4.11 in test mode.

How did you get past this error?

1) test Testing the Posts Query Should get all posts(1 of 1) (WolfBlogWeb.Schema.Posts.Queries.PostsQueryTest)
     test/wolf_blog_web/schema/posts/queries/posts_query_test.exs:17
     ** (MatchError) no match of right hand side value: {:already, :owner}
     stacktrace:
       (wolf_blog) test/support/conn_case.ex:32: WolfBlogWeb.ConnCase.__ex_unit_setup_0/1
       (wolf_blog) test/support/conn_case.ex:1: WolfBlogWeb.ConnCase.__ex_unit__/2
       test/wolf_blog_web/schema/posts/queries/posts_query_test.exs:1: WolfBlogWeb.Schema.Posts.Queries.PostsQueryTest.__ex_unit__/2

Update: Can confirm that it is Db related because my seeder works for dev mode but not for testing mode.
Thanks

Solved in this thread Absinthe no schema for the api route