Exercise 1: Raising the Fixed Wait to 80ms — Possible Solution ==================================================================== RESULTS ------------------------------ 80ms fixed-wait test over 200 runs: 156 passed, 44 failed Pass rate: 78.0% (30ms version, same random seed, for comparison: 47/200 passed, 23.5%) WHY IT'S HIGHER BUT STILL NOT 100% ------------------------------ The simulated load time is uniformly distributed between 10ms and 100ms. Waiting 80ms covers roughly 78% of that range (from 10ms up to 80ms is 70 of the full 90ms spread, closely matching the measured 78.0% pass rate) - but any load time between 80ms and 100ms still exceeds the fixed wait and still fails. Raising the wait narrows the window of failure; it doesn't close it, because the wait is still a guess at an upper bound rather than a check of the actual condition. WHY THIS WORKS AS AN ANSWER ------------------------------ This demonstrates the core problem with fixed waits precisely: any finite fixed wait either has to guess so generously that it slows down every single test run to cover a rare worst case, or accept some nonzero flake rate for whatever fraction of real-world timing exceeds it. The chapter's own polling-based fix sidesteps this entirely by checking the real condition rather than betting on a duration - which is why it measured 100%, not just "a higher percentage," across the same 200 simulated load times.