Skip to content

fix(tests): smoke_sha_gate main() tests no longer drift with the real clock - #375

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/smoke-sha-gate-date-drift
Nov 26, 2026
Merged

Jammy2211 merged 1 commit into
mainfrom
feature/smoke-sha-gate-date-drift

Conversation

@Jammy2211

Copy link
Copy Markdown
Contributor

Summary

Heart Tests on main have failed since 2026-11-26. smoke_sha_gate.main() reads the real clock, but its two main() 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 passed
  • Full Heart suite: 1523 passed, 0 failed (main: 1521 passed, 2 failed)
  • Date independence: the sha-gate tests rerun with datetime.now shifted +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.
  • Heart Tests green on this PR

Corrective-PR exception for Heart RED

Full API Changes (for automation & release notes)

Changed

  • tests/test_smoke_sha_gate.py: new _recent_full_sweep_ts() helper; the two main() tests use it.

Generated by the PyAutoLabs agent workflow.

🤖 Generated with Claude Code

… 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>
@Jammy2211
Jammy2211 merged commit a8ac38b into main Nov 26, 2026
2 checks passed
@Jammy2211
Jammy2211 deleted the feature/smoke-sha-gate-date-drift branch November 26, 2026 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(tests): smoke_sha_gate main() tests drift with the real clock

1 participant