Repository navigation
test(usage): pin checkpoint fixture clock after scan yields - #8571
Conversation
|
✅ Deterministic PR hygiene checks passed. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
✅ READY
Review readiness checklist
✅ 4/4 boxes ticked. This pull request is already Ready for Review. Hygiene✅ Deterministic PR hygiene checks passed. |
Ingwannu
left a comment
There was a problem hiding this comment.
Approved for exact head dafb1841ec6c3fc1b99f962acac44a60c00e189f targeting dev.
The one-file diff pins the monotonic clock only around the checkpoint rewrite fixture and restores it in finally. The returned digest still has to match the previously verified bytes, and the subsequent append scan still must reject content_changed; the separate elapsed-yield/cancellation cases are unchanged. I read the actual hosted test-changed log in run43418305333: the checkpoint case and the neighboring yield/cancellation/integrity controls executed successfully. The gates Typecheck step and aggregate ci are successful.
Fresh Ready/head/review/thread state is clear and the branch is within the policy ancestry limit. Other Cargo workloads occupied the shared local host, so local testing was deferred without overlapping/killing that work or raising limits. Hosted execution and author receipts are identified above. No live service/config/native-account change, scan, new cross-platform dispatch, merge or release was performed.
|
Maintainer integration into
Thanks @atinseau. |
Summary
The checkpoint-digest test can fail with
content_changedon a loaded worker after #8455. Its fourth cancellation check deliberately rewrites the ledger after verification, but an 8 ms row yield adds an earlier check and triggers the rewrite before verification. Pin the monotonic clock only in this fixture and restore it infinally; keep the scanner's elapsed-time and cancellation tests on their existing controlled clocks.Addresses the post-merge CodeRabbit finding on #8455 and the Codex finding at #8455 (comment). Runtime scheduling, cancellation checks, the 750 ms health probe and lock-acquisition budget are unchanged. No user documentation change is needed for this test-only fix.
Verification
Current-head validation at
52435fff938f29b7969c6afec2b9ce95b9e26e43after mergingdev873ec9b3b8ddf63f06738748d9132d779abefb42:bun test tests/usage/usage-ledger-scanner.test.ts: 23 pass, 0 fail, including elapsed-time yields and post-yield cancellation.bun run typecheck: no errors in 2,533 files.bun run privacy:scan,bun run structure:checkandgit diff --check --cached origin/dev(before this commit): pass.bun test tests/ci-workflows/file-size-ratchet.test.ts: 9 pass, 0 fail.114698a7: an advancing 9 ms clock makes the original checkpoint fixture fail withcontent_changed; only that fixture clock is pinned by the fix. That reproduction was not repeated for this base refresh.Checklist
Review readiness checklist
Ready for review based on the verified local checks above. This does not attest completion of a fresh automated review or required CI.
Summary by CodeRabbit