From fd3cb0be5591d3f63aeafc0f9debef3846c339a5 Mon Sep 17 00:00:00 2001 From: Victor Farazdagi Date: Fri, 5 Jun 2020 14:26:10 +0300 Subject: [PATCH] Re-enables multi-failure test case in round robin (#6143) * re-enables multi-failure test case in round robin --- .../sync/initial-sync/blocks_queue.go | 2 +- .../sync/initial-sync/round_robin_test.go | 62 +++++++++---------- 2 files changed, 31 insertions(+), 33 deletions(-) diff --git a/beacon-chain/sync/initial-sync/blocks_queue.go b/beacon-chain/sync/initial-sync/blocks_queue.go index 0dff2af79..96ff7e5ce 100644 --- a/beacon-chain/sync/initial-sync/blocks_queue.go +++ b/beacon-chain/sync/initial-sync/blocks_queue.go @@ -141,7 +141,7 @@ func (q *blocksQueue) loop() { q.highestExpectedSlot = q.blocksFetcher.bestFinalizedSlot() continue } - log.Debug("Highest expected slot reached") + log.WithField("slot", q.highestExpectedSlot).Debug("Highest expected slot reached") q.cancel() } diff --git a/beacon-chain/sync/initial-sync/round_robin_test.go b/beacon-chain/sync/initial-sync/round_robin_test.go index 3261b58f8..f9f0627b1 100644 --- a/beacon-chain/sync/initial-sync/round_robin_test.go +++ b/beacon-chain/sync/initial-sync/round_robin_test.go @@ -117,38 +117,36 @@ func TestRoundRobinSync(t *testing.T) { }, }, }, - - // TODO(3147): Handle multiple failures. - //{ - // name: "Multiple peers with multiple failures", - // currentSlot: 320, // 10 epochs - // expectedBlockSlots: makeSequence(1, 320), - // peers: []*peerData{ - // { - // blocks: makeSequence(1, 320), - // finalizedEpoch: 4, - // headSlot: 320, - // }, - // { - // blocks: makeSequence(1, 320), - // finalizedEpoch: 4, - // headSlot: 320, - // failureSlots: makeSequence(1, 320), - // }, - // { - // blocks: makeSequence(1, 320), - // finalizedEpoch: 4, - // headSlot: 320, - // failureSlots: makeSequence(1, 320), - // }, - // { - // blocks: makeSequence(1, 320), - // finalizedEpoch: 4, - // headSlot: 320, - // failureSlots: makeSequence(1, 320), - // }, - // }, - //}, + { + name: "Multiple peers with multiple failures", + currentSlot: 320, // 10 epochs + expectedBlockSlots: makeSequence(1, 320), + peers: []*peerData{ + { + blocks: makeSequence(1, 320), + finalizedEpoch: 9, + headSlot: 320, + }, + { + blocks: makeSequence(1, 320), + finalizedEpoch: 9, + headSlot: 320, + failureSlots: makeSequence(1, 320), + }, + { + blocks: makeSequence(1, 320), + finalizedEpoch: 9, + headSlot: 320, + failureSlots: makeSequence(1, 320), + }, + { + blocks: makeSequence(1, 320), + finalizedEpoch: 9, + headSlot: 320, + failureSlots: makeSequence(1, 320), + }, + }, + }, { name: "Multiple peers with different finalized epoch", currentSlot: 320, // 10 epochs