Skip to content

Conversation

SteffenDE
Copy link
Collaborator

No description provided.

@josevalim
Copy link
Member

I prefer the other one :)

@SteffenDE
Copy link
Collaborator Author

@josevalim both this and #3990 doesn't work. The LiveView channels are started under the test supervisor and because the tasks are still linked to the channel and don't trap exits themselves, quoting the docs

:shutdown - :brutal_kill if the tasks must be killed directly on shutdown or an integer indicating the timeout value, defaults to 5000 milliseconds. The tasks must trap exits for the timeout to have an effect.

they still exit immediately and we get a DBConnection.ConnectionError.

I tested this by creating a fresh project, running phx.gen.auth and adding a

socket =
      assign_async(socket, :foo, fn ->
        Dayzee.Repo.transact(fn ->
          Process.sleep(10)

          {:ok, %{foo: :bar}}
        end)
      end)

into the mount of login.ex.

@SteffenDE SteffenDE closed this Sep 12, 2025
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

Successfully merging this pull request may close these issues.

2 participants