3 ms·
> Dirty databases make the tests non-deterministic. If this breaks your tests, you have a concurrency bug, pure and simple. Either in your code, or in your tes
by pmarreck 5y ago
> Dirty databases make the tests non-deterministic.
If this breaks your tests, you have a concurrency bug, pure and simple. Either in your code, or in your test assertions.
Your test assertions (like your code) should never assume that what you just put into the database is the only thing in there which will match, or the last thing that was put in there.
In my case (working in Elixir/Phoenix), it runs all the tests concurrently. This will cause any concurrency issue to crop up real quick, and that's exactly how I like it.