Fix a flaky test
A test that fails sometimes is worse than no test.
This test passes sometimes and fails sometimes: <paste the test and the code under test> Find the source of the non-determinism: - Timing — a fixed wait instead of waiting for a condition. - Shared state between tests, or tests depending on run order. - Real dates, times or randomness. - Real network calls. - Database state not reset between runs. - Parallel tests touching the same records. Fix it properly. Do not add a retry or increase a timeout to hide it — if the code under test has a real race, I want to know that instead.
Retrying a flaky test converts a real bug into an intermittent production incident. The flakiness is often the code, not the test.