discovery: fix flaky TestGossipSyncerSyncTransitions #11574
All Vouch review confidence checks passed
Residual risk 0.15 = Change Risk (0.35) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.35 · 172 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.308
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #11574"
general
weight: 0.35
litbot-9000
Description
Fixes a flaky unit test seen failing in CI on an unrelated PR:
https://github.com/lightningnetwork/lnd/actions/runs/42982273166/job/131243808607
TestGossipSyncerSyncTransitionsasserted an exactFirstTimestampforthe
GossipTimestampRangemessage the syncer sends when (re)enteringactive sync. The syncer stamps the message with its own clock (in
processSyncTransition, and in thechansSyncedstartup path for aninitially-active syncer), while the test sampled
time.Now()for itsexpectation only after
ProcessSyncTransitionhad returned. If awall-clock second boundary was crossed in between, the expectation ran
one second ahead of the stamped value:
Fix
Sample the time just before
syncer.Start()and assert that the stampedfirst timestamp falls within
[startTime, now](and thatTimestampRange == math.MaxUint32) instead of comparing exact values.Both affected sub-tests are fixed: "active to passive" (message sent at
startup) and "passive to active" (message sent on transition).
Verification
go test ./discovery/ -run TestGossipSyncerSyncTransitions -count=300 -race— passgo test ./discovery/ -race(full package) — passgofmt,go vet— clean---
View the OpenClaw team session