60% of the time, it works every time
Bugs that occur only some of the time add another layer of complexity (and frustration) when debugging them.
One cause of these is timing issues. Asynchronous systems are particularly susceptible. Any sort of magic timeout will be problematic. Best practices like callbacks are key.
These issues show up in application code and in tests. A flaky test, which is one that sometimes passes and sometimes doesn’t, is a buggy test. Use your debugging skills to diagnose and fix timing issues wherever they appear.