We can't find the internet
Attempting to reconnect
Something went wrong!
Hang in there while we get back on track
Keeping timeouts active while tracing tests
almirsarajcic
0 comments
Copy link
A test can stop timing out when you rerun it with --trace:
@tag timeout: 10
test "slow work" do
Process.sleep(50)
assert true
end
mix test fails this test after 10 milliseconds. mix test --trace passes it because trace mode sets test timeouts to infinity, not only max_cases to 1.
If you only need serial execution while chasing a race, keep the timeout active:
mix test test/slow_test.exs --max-cases 1
Mind you, --slowest and --slowest-modules enable trace mode too.
https://hexdocs.pm/mix/Mix.Tasks.Test.html#module-command-line-options
copied to clipboard