mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-18 10:50:44 +00:00
Merge 0117b01ec4 into dddbaa4bf3
This commit is contained in:
commit
725ac90c82
2 changed files with 18 additions and 11 deletions
|
|
@ -456,8 +456,8 @@ func testCanonSync(t *testing.T, protocol uint, mode SyncMode, snapV2 bool) {
|
|||
select {
|
||||
case <-success:
|
||||
assertOwnChain(t, tester, len(chain.blocks))
|
||||
case <-time.NewTimer(time.Second * 3).C:
|
||||
t.Fatalf("Failed to sync chain in three seconds")
|
||||
case <-time.NewTimer(time.Second * 30).C:
|
||||
t.Fatalf("Failed to sync chain in time")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -605,8 +605,8 @@ func testEmptyShortCircuit(t *testing.T, protocol uint, mode SyncMode) {
|
|||
HighestBlock: uint64(len(chain.blocks) - 1),
|
||||
CurrentBlock: uint64(len(chain.blocks) - 1),
|
||||
})
|
||||
case <-time.NewTimer(time.Second * 3).C:
|
||||
t.Fatalf("Failed to sync chain in three seconds")
|
||||
case <-time.NewTimer(time.Second * 30).C:
|
||||
t.Fatalf("Failed to sync chain in time")
|
||||
}
|
||||
assertOwnChain(t, tester, len(chain.blocks))
|
||||
|
||||
|
|
@ -679,8 +679,8 @@ func testBeaconSync(t *testing.T, protocol uint, mode SyncMode) {
|
|||
if bs := int(tester.chain.CurrentBlock().Number.Uint64()) + 1; bs != len(chain.blocks) {
|
||||
t.Fatalf("synchronised blocks mismatch: have %v, want %v", bs, len(chain.blocks))
|
||||
}
|
||||
case <-time.NewTimer(time.Second * 3).C:
|
||||
t.Fatalf("Failed to sync chain in three seconds")
|
||||
case <-time.NewTimer(time.Second * 30).C:
|
||||
t.Fatalf("Failed to sync chain in time")
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
@ -790,8 +790,8 @@ func testSyncProgress(t *testing.T, protocol uint, mode SyncMode) {
|
|||
CurrentBlock: uint64(len(chain.blocks)/2 - 1),
|
||||
HighestBlock: uint64(len(chain.blocks)/2 - 1),
|
||||
})
|
||||
case <-time.NewTimer(time.Second * 3).C:
|
||||
t.Fatalf("Failed to sync chain in three seconds")
|
||||
case <-time.NewTimer(time.Second * 30).C:
|
||||
t.Fatalf("Failed to sync chain in time")
|
||||
}
|
||||
|
||||
// Synchronise all the blocks and check continuation progress
|
||||
|
|
@ -809,8 +809,8 @@ func testSyncProgress(t *testing.T, protocol uint, mode SyncMode) {
|
|||
CurrentBlock: uint64(len(chain.blocks) - 1),
|
||||
HighestBlock: uint64(len(chain.blocks) - 1),
|
||||
})
|
||||
case <-time.NewTimer(time.Second * 3).C:
|
||||
t.Fatalf("Failed to sync chain in three seconds")
|
||||
case <-time.NewTimer(time.Second * 30).C:
|
||||
t.Fatalf("Failed to sync chain in time")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -922,7 +922,14 @@ func TestSkeletonSyncRetrievals(t *testing.T) {
|
|||
endpeers = append(tt.peers, tt.newPeer)
|
||||
}
|
||||
if tt.newHead != nil {
|
||||
skeleton.Sync(tt.newHead, nil, true)
|
||||
// The head announcement is rejected if it arrives while the previous
|
||||
// sync cycle is still tearing down (head events are dropped on the
|
||||
// floor during teardown, see #27397). Retry until the syncer accepts
|
||||
// the new head, otherwise the update is lost and the end state below
|
||||
// is never reached.
|
||||
for skeleton.Sync(tt.newHead, nil, true) != nil {
|
||||
time.Sleep(10 * time.Millisecond)
|
||||
}
|
||||
}
|
||||
|
||||
// Wait a bit (bleah) for the second sync loop to go to idle. This might
|
||||
|
|
|
|||
Loading…
Reference in a new issue