In plain words
A flaky test passes on one run and fails on the next with identical code, usually because it depends on timing, test order, today's date or a network call.
Where you see it
Harbor's CI goes red on the invoice-download test about one run in five, someone clicks Re-run, and it goes green. A month later the team re-runs every failure without reading it, including the one that was real.
What goes wrong
- Fixing it with a longer sleep
Raising the wait from 2 to 5 seconds makes the failure rarer and every run slower. Wait for the thing you need instead: a response, an element, a download.
- Tests that depend on today's date
A test that expects the next invoice on the 31st fails in every month with 30 days. Freeze the clock in tests, for example with vi.useFakeTimers() and vi.setSystemTime().
- Retrying until green and moving on
Automatic retries hide the problem and teach the team to ignore red. Quarantine a flaky test with a ticket and an owner, and fix or delete it within days.
What to tell your agent
Quick check
Sign in to earn +10 XP for itA Harbor test fails about once a week with a timeout. The agent proposes raising the timeout from 5 to 30 seconds. What's the better move?