A browser test read the page on a fixed clock that started before the page loaded, while the code under test starts its own timer only once its script runs. On a slow machine the test fails on a correct build.
Start a test clock where the code starts its clock. Page load time is not part of the timer under test.
Wait for a state, not a fixed sleep. A busy runner moves every fixed sleep.
Wait for a state, not a fixed sleep. A busy runner moves every fixed sleep.