Summary
Avoid non-determinism in tests.
To overcome non-determinism due to asynchronous execution: Separate domain logic from the code that deals with asynchrony. ...
To overcome non-determinism due to working with time: Use dependency injection to pass the current time around