On_exit callback not async in tests?

Wondering if the on_exit fn in the test setup function “breaks” the asyncronous test runs.

According to docs, it should not, since each callback is executed into a separate process, but if a “long” task is put into the on_exit callback, times will increase proportionally.

So, if I have a 1 second task in each on_exit callback, being parallel, I don’t expect proportional delays, but just a 1 second increase (or something like that).

What is happening, is that the test run time instead is proportional to the number of test number on_exit callback execution time.

I’ve put a demo test here: https://github.com/xadhoom/test_on_exit

If you run the test suite, it should run in 1 second (more or less), instead it takes 4 seconds.

I’m missing something?

mmmh, reading better the doc states:

on_exit/2 callbacks always run in a separate process than the test case or the test itself

So it is a single process that handles all on_exit callbacks sequentially ?
Or a separate process for each test?

If is the first case, the async effectiveness may suffer if doing something expensive in the exit_fn callback (can be considered a bug?)

tests inside a case are run serially. only test-cases (“modules”) are run asynchronously.

as all your tests are inside just one case, they will always be run serially.

Well,

thanks, I totally misread the definition about async :slight_smile: