How to get Ecto stream respond in ExUnit

Ohh, I am very sorry, I get involved in Covid-19 and I forgot to update this post :face_with_head_bandage:

Step one

this problem was because I was using handle_cast for pushing data to my state, hence when I send many data in a loop I thought some session was not closed and the program waited for it. After that, I changed it with handle_call and it was fixed.

Step two

I add these line top of my test code

  setup_all _tags do
    :ok = Ecto.Adapters.SQL.Sandbox.checkout(MishkaDatabase.Repo)
    Ecto.Adapters.SQL.Sandbox.mode(MishkaDatabase.Repo, :auto)
    on_exit fn ->
      :ok = Ecto.Adapters.SQL.Sandbox.checkout(MishkaDatabase.Repo)
      Ecto.Adapters.SQL.Sandbox.mode(MishkaDatabase.Repo, :auto)
      clean_db()
      :ok
    end
    [this_is: "is"]
  end

Step three

I changed ExUnit.Case, async to false

At the end

These are from my fork project

Test file:

https://github.com/shahryarjb/mishka-cms/blob/master/apps/mishka_installer/test/plugin_manager/state/plugin_database_test.exs

My state manager

https://github.com/shahryarjb/mishka-cms/tree/master/apps/mishka_installer/lib/plugin_manager/state

And my hook function

https://github.com/shahryarjb/mishka-cms/blob/master/apps/mishka_installer/lib/plugin_manager/event/hook.ex#L143-L157

Sorry again and thank you. For now, I have no issue, but if I can find anything I will update this post again.