Repository navigation
test(node): isolate sync lag observations - #662
Merged
Merged
Conversation
Contributor
jatmn
approved these changes
Dec 2, 2026
jatmn
left a comment
Collaborator
There was a problem hiding this comment.
🟢 Thanks for the contribution. I do not see any actionable issues from my review.
Merge readiness
- GitHub reports the PR as mergeable with required CI green on head (
fmt + clippy,test (stable),test (beta), and related checks). - Merge policy shows BLOCKED (approval/review gate), not a code defect.
- Live
main(617e876) is 14 commits ahead of this branch’s merge-base (cb4f277). This diff does not touch release metadata, andsync.rs/metrics.rswere not modified onmainin that range — rebase is optional hygiene, not required to resolve conflicts for this change set. - Author checklist still has unchecked template items for “new behavior covered by tests” and strict local Clippy; CI
fmt + clippypassed on the PR run, consistent with the author’sdouble_must_usenote on unchangedBlockStorecode.
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
The sync lag tests now check their own observations. The sync worker still records to the same Prometheus histogram under the same conditions.
Motivation & context
In the failed CI run on #651, the failed-tip test expected the histogram count to stay at 1 but read 2. Both tests use the same process-wide histogram, so a sample from another test can land between those reads.
Kind of change
What changed
twigpine-node: pass the sample recorder into the lag gate. The worker passes the existing metric recorder, and the tests use callbacks that don't touch the shared histogram.How a reviewer can verify
Set
DATABASE_URLto a local PostgreSQL 16 database, then run:Formatting passed. On PostgreSQL 16.16, each workspace run had 3,836 passed, 0 failed, and 20 ignored. Both lag-gate tests passed in every run.
Before you request review
cargo test --workspacepasses locallycargo fmt --allandcargo clippy --workspace --all-targets -- -D warningsare cleanfeat(...),fix(...),docs(...)).env.exampleupdated if behavior or config changed (or N/A)Notes for reviewers
Strict local Clippy reported
double_must_usein the unchangedBlockStoretrait. With only that lint allowed, Clippy passed:Summary by CodeRabbit