Repository navigation
test(reports): freeze the clock in the stale retry boundary test - #44651
Conversation
test_stale_retry_recovers_at_max_delay sets last_eval_dttm from a microsecond-truncated timestamp, while the claim measures its age with datetime.utcnow(). The truncation plus the test's own runtime could push the 3599 second case past the 3600 second delay on a slow runner, so it was claimed and the test failed intermittently in CI. Freeze the clock at the test's timestamp so both sides agree. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Code Review Agent Run #cc31f0Actionable Suggestions - 0Additional Suggestions - 1
Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #44651 +/- ##
==========================================
- Coverage 81.10% 81.10% -0.01%
==========================================
Files 2955 2955
Lines 178385 178385
Branches 41336 41336
==========================================
- Hits 144680 144678 -2
- Misses 30996 30998 +2
Partials 2709 2709
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
SUMMARY
test_stale_retry_recovers_at_max_delay[*-sqlite-3599-False]fails intermittently in CI, for example on #44650 (run):The test builds
last_eval_dttmfromutc_now().replace(microsecond=0), which can be up to a second behind the real clock._claim_executionthen measures the row's age withdatetime.utcnow(). The effective age of the "3599 seconds" case is therefore 3599 s, plus the dropped fraction, plus however long the test takes. On a slow runner that reaches the 3600 s delay, the claim goes through, and the test fails.The fix freezes the clock at the test's timestamp for the test body, so both sides read the same time. Only the test changes.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A
TESTING INSTRUCTIONS
To reproduce the flake, add
time.sleep(1.1)just before theclaim_execution(...)call in the test. On master the two3599-Falsecases fail with the CI error above. With this change they still pass.ADDITIONAL INFORMATION
🤖 Generated with Claude Code