test(eth): stabilize fast sync disabling test#2350
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR updates eth sync testing to make TestFastSyncDisabling more tolerant of CI scheduling variance and to add protocol manager cleanup.
Changes:
- Adds deferred
ProtocolManager.Stop()calls for the test protocol managers. - Replaces fixed sleep plus one-shot sync with a retry loop bounded by a 15-second timeout.
| defer pmEmpty.Stop() | ||
| if atomic.LoadUint32(&pmEmpty.snapSync) == 0 { | ||
| t.Fatalf("snap sync disabled on pristine blockchain") | ||
| } | ||
| // Create a full protocol manager, check that snap sync gets disabled | ||
| pmFull, _ := newTestProtocolManagerMust(t, downloader.FastSync, 1024, nil, nil) | ||
| defer pmFull.Stop() |
cfff7d9 to
d14b66c
Compare
d14b66c to
75fa05c
Compare
Replace the fixed sleep and one-shot synchronise call with a timeout-based retry loop so the test tolerates CI scheduling variance. Add protocol manager cleanup to avoid leaking background work between test runs.
75fa05c to
d01d487
Compare
Proposed changes
Replace the fixed sleep and one-shot synchronise call with a timeout-based retry loop so the test tolerates CI scheduling variance. Add protocol manager cleanup to avoid leaking background work between test runs.
Types of changes
What types of changes does your code introduce to XDC network?
Put an
✅in the boxes that applyImpacted Components
Which parts of the codebase does this PR touch?
Put an
✅in the boxes that applyChecklist
Put an
✅in the boxes once you have confirmed below actions (or provide reasons on not doing so) that