Fix test_task_announcements flake with immediate heartbeat#216
Fix test_task_announcements flake with immediate heartbeat#216chrisguidry merged 1 commit intomainfrom
Conversation
Workers now send their first heartbeat immediately on startup instead of waiting for the first interval. This fixes a race condition where `task_workers()` could be called before any heartbeat was sent on heavily loaded CI machines. Changes: - Reorder `_heartbeat()` to send heartbeat before sleeping - Update `test_worker_publishes_depth_gauges` to allow multiple heartbeats - Clean up temp worker heartbeat data in `key_leak_checker` fixture Flake: https://github.com/chrisguidry/docket/actions/runs/20075820763/job/57589737809 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
Claude finished @chrisguidry's task —— View job Code Review for PR #216Review Checklist
SummaryThis PR effectively fixes a race condition where Detailed Review✅ Strengths
✅ Code Quality
✅ Performance
✅ Security
✅ Test Coverage
💭 Minor Suggestions (Optional)
ConclusionThis is a well-crafted fix that solves the race condition cleanly. The immediate heartbeat on startup is the right approach, and the test adjustments properly account for the new behavior. The cleanup in conftest.py is a nice addition to prevent test pollution. Approved ✅ - Ready to merge. |
|
📚 Documentation has been built for this PR! You can download the documentation directly here: |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #216 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 48 48
Lines 7740 7745 +5
Branches 402 403 +1
=========================================
+ Hits 7740 7745 +5
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Workers now send their first heartbeat immediately on startup instead of
waiting for the first interval. This fixes a race condition where
task_workers()could be called before any heartbeat was sent on heavilyloaded CI machines.
Changes:
_heartbeat()to send heartbeat before sleepingtest_worker_publishes_depth_gaugesto allow multiple heartbeatskey_leak_checkerfixtureFlake: https://github.com/chrisguidry/docket/actions/runs/20075820763/job/57589737809
🤖 Generated with Claude Code