I was making the setup for running the tests against the user interface( Part 2, Chapter 8).
There is a race condition there, because checking the cash slot contents and the account balance on one side, and updating these two resources by the web client on the other side, are running in parallel.
Unlike the code in the book, I use a selenium ChromeDriver and the winner in this race condition is the test step that checks the cash slot contents. Because the contents are checked before they are updated, the scenario fails.
Using the code in the book (with a selenium FirefoxDriver) the winner is the code that updates the two resources (cash slot contents and the account balance) as a result of client http request. If I run it multiple times, the result is the same: scenario passes every time, although I shall not hold my breath.