CI for the reminders service fails one run in five, and the team has started clicking retry. The flakes come from the wall clock, test order, set ordering and random IDs, and one of them hides a real bug. Make the suite deterministic while keeping it able to catch regressions.
This is the practice version. Assessments always use a variant you have never seen.
CI has been red one run in five for a month, and people now press retry without reading the logs. The reminders service (scheduler/) is fine in production, mostly. Its tests are not:
CI_FLAKES.md lists the failures people have seen.
tests/ deterministic: it must pass at any wall-clock time and date, in any test order, with each
test run alone, and with any PYTHONHASHSEED.scheduler/. Fix them: reminder_tags must return a sorted list, and
new_id must never collide.Graders run your suite under frozen clocks, shuffled orders and different hash seeds.