Skip to content

Commit

Permalink
eth/downloader: fix off-by-one error in test causing 50% fails
Browse files Browse the repository at this point in the history
  • Loading branch information
karalabe authored and cp-wjhan committed Nov 16, 2022
1 parent 569322f commit ac4fc56
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions eth/downloader/skeleton_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -742,13 +742,13 @@ func TestSkeletonSyncRetrievals(t *testing.T) {
head: chain[2*requestHeaders],
peers: []*skeletonTestPeer{
newSkeletonTestPeerWithHook("peer-1", chain, func(origin uint64) []*types.Header {
if origin == chain[2*requestHeaders+2].Number.Uint64() {
if origin == chain[2*requestHeaders+1].Number.Uint64() {
time.Sleep(100 * time.Millisecond)
}
return nil // Fallback to default behavior, just delayed
}),
newSkeletonTestPeerWithHook("peer-2", chain, func(origin uint64) []*types.Header {
if origin == chain[2*requestHeaders+2].Number.Uint64() {
if origin == chain[2*requestHeaders+1].Number.Uint64() {
time.Sleep(100 * time.Millisecond)
}
return nil // Fallback to default behavior, just delayed
Expand Down

0 comments on commit ac4fc56

Please sign in to comment.