Trouble with intermittent failing tests

I tried moving the Hotspot.find call into my test, this is essentially the call that searches the db, creates the process and registers it. I then ran mix test several times, but after 7 tests it failed at that point in my test with the same error.

Was that the only place where you access the database from within another process other than the test?

Maybe you have the issue we occasionally have. See here for more information: Tests randomly failing when run in a VM - #7 by mbaeuerle

The gist is:
On a fast machine even when waiting on the workers finish using the database the error occurs randomly.

You could try to run the tests of the minimal case I created. If this fails on your machine (running it several times), then you have the same problem. Unfortunately there is no solution yet.