Use random behavior only in this way
The previous chapter mentioned using random behavior in tests, and it’s important for you to understand more about this so that your tests are predictable and repeatable.
Predictability and randomness are about as opposite as you can get. How should we reconcile these two properties? The first thing to understand is that the tests you write should be predictable. If a test passes, then it should always pass unless something outside of your control fails, such as a hard drive crashing in the middle of your tests. There’s no way to predictably handle accidents like that, and that’s not what I’m talking about. I mean that if a test passes, then it should continue to pass until some code change causes it to fail.
And when a test fails, then it should continue to fail until the problem is fixed. The last thing you want is to add random behavior to your tests so that you sometimes do one thing and other times do another...