Repository navigation
fix(tests): smoke_sha_gate main() tests no longer drift with the real clock - #375
Merged
Merged
Conversation
… clock main() reads datetime.now(), but the two main() tests built the previous record with a fixed 2026-11-18 full-sweep time. Once that was 7 days old the gate correctly forced a sweep and the tests failed (Heart Tests red on main since 2026-11-26). They now use a full-sweep time one day before the real clock. Test-only; the gate and FULL_SWEEP_MAX_AGE_DAYS are unchanged. Corrective PR for Heart RED "PyAutoHeart: Heart Tests failure on main" (PyAutoHeart#374). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Heart Tests on main have failed since 2026-11-26.
smoke_sha_gate.main()reads the real clock, but its twomain()tests built the previous record with a fixed full-sweep time (2026-11-18T03:00:00Z). Once that was 7 days old, the gate correctly forced a full sweep (FULL_SWEEP_MAX_AGE_DAYS) and the tests' "no main moved" expectation failed. The tests now use a full-sweep time one day before the real clock. Test-only: the gate and the 7-day rule are unchanged. Closes #374.API Changes
None (test-only).
See full details below.
Test Plan
tests/test_smoke_sha_gate.py: 29 passeddatetime.nowshifted +30 and +365 days, 29 passed each time. Control: main's version under +30 days fails the same 2 tests, so the shift is effective.Corrective-PR exception for Heart RED
pyauto-heart readiness --dev --repos PyAutoHeart, 2026-11-26):PyAutoHeart: Heart Tests failure on main— this is the only RED reason, and this diff clears it.main()tests) → diff (tests/test_smoke_sha_gate.pyonly)./prm; release stays blocked while Heart is RED.Full API Changes (for automation & release notes)
Changed
tests/test_smoke_sha_gate.py: new_recent_full_sweep_ts()helper; the twomain()tests use it.Generated by the PyAutoLabs agent workflow.
🤖 Generated with Claude Code