Fl4m3Ph03n1x
Default value for ExUnit.Case async
I always thought that the default value for ExUnit.Case, async was true. However in a recent video from ElixirCasts the author states otherwise:
Am I mistaken?
Do I need to use ExUnit.Case, async: true if I want concurrent tests?
I couldn’t find anything in the official docs:
Marked As Solved
lpil
Looks like it default to false elixir/lib/ex_unit/lib/ex_unit/case.ex at 3a3d68385ef02148136ff4b9490c70d3e6d3dbc3 · elixir-lang/elixir · GitHub
Also Liked
hauleth
The problem is that async: true does something different from what people may expect. Tests in single module are always run synchronously, no deviations. async: true mean that tests in given module can be ran in parallel with other modules. So this would produce unexpected results when used with some persistent storage tools, when used without special preparations, or other hard to reason problems. Instead they have chosen to “safer default”. If you want to check your code for concurrency errors then you can check out Concuerror.
lpil
I’d prefer it to default to concurrent, to nudge us into writing code that is safe to run concurrently by default ![]()








