Skip to content

Commit 0405f72

Browse files
committed
[release/1.4.7] eth/downloader: fix occasional fast sync critical section test fails
(cherry picked from commit 7832890)
1 parent 63c5a46 commit 0405f72

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

eth/downloader/downloader_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1824,13 +1824,15 @@ func testFastCriticalRestarts(t *testing.T, protocol int) {
18241824
for i := 0; i < fsPivotInterval; i++ {
18251825
tester.peerMissingStates["peer"][headers[hashes[fsMinFullBlocks+i]].Root] = true
18261826
}
1827+
tester.downloader.dropPeer = func(id string) {} // We reuse the same "faulty" peer throughout the test
1828+
18271829
// Synchronise with the peer a few times and make sure they fail until the retry limit
18281830
for i := 0; i < fsCriticalTrials; i++ {
18291831
// Attempt a sync and ensure it fails properly
18301832
if err := tester.sync("peer", nil, FastSync); err == nil {
18311833
t.Fatalf("failing fast sync succeeded: %v", err)
18321834
}
1833-
time.Sleep(500 * time.Millisecond) // Make sure no in-flight requests remain
1835+
time.Sleep(100 * time.Millisecond) // Make sure no in-flight requests remain
18341836

18351837
// If it's the first failure, pivot should be locked => reenable all others to detect pivot changes
18361838
if i == 0 {

0 commit comments

Comments
 (0)