Fixing Flaky Tests
Every test suite has them: a few tests that usually pass but sometimes mysteriously fail when run on the same code. Since they can’t be reliably replicated, they can be difficult to fix. The good news for software testing is that there is a set of usual suspects that cause these issues: test order, async code, time, sorting and randomness.