elixir-lang / elixir

Elixir is a dynamic, functional language for building scalable and maintainable applications
https://elixir-lang.org/
Apache License 2.0
24.62k stars 3.38k forks source link

Running a single test file does not apply endless timeout with --trace #9630

Closed danilokleber closed 5 years ago

danilokleber commented 5 years ago

Environment

Erlang/OTP 22 [erts-10.4.4] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [hipe]
Elixir 1.9.0 (compiled with Erlang/OTP 20)

Current behavior

I'm trying to use require IEx; IEx.pry to debug something. So I run iex -S mix test --trace to get rid of the db timeout. However when I try to run just one file or test using iex -S mix test --trace path/to/file it ignores the infinity timeout set by the --trace option and gives the following after 1 minute:

[error] Postgrex.Protocol (#PID<0.430.0>) disconnected: ** (DBConnection.ConnectionError) owner #PID<0.470.0> timed out because it owned the connection for longer than 60000ms (set via the :ownership_timeout option)

I also have tried a few other options to disable timeout with no success in that specific case of running a single file/test.

Expected behavior

It should be the same as when I run the full test suite.

josevalim commented 5 years ago

@danilokleber the timeout you are getting is not coming from ExUnit, but rather from your database configuration. You can set ownership_timeout: ... to a higher value when configuring your repository. I believe recent versions bumped it to infinity but you can do it yourself. :)