From 28466e4cf220ccd899d272940b533ddf68554125 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Tue, 29 Jan 2019 16:36:56 +0100 Subject: [PATCH] p2p/discover: really fix tests --- p2p/discover/udp_test.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/p2p/discover/udp_test.go b/p2p/discover/udp_test.go index aad5654825..9b0520fbc9 100644 --- a/p2p/discover/udp_test.go +++ b/p2p/discover/udp_test.go @@ -286,8 +286,13 @@ func TestUDP_findnode(t *testing.T) { } }) } - waitNeighbors(expected.entries[:maxNeighbors]) - waitNeighbors(expected.entries[maxNeighbors:]) + // Receive replies. + want := expected.entries + if len(want) > maxNeighbors { + waitNeighbors(want[:maxNeighbors]) + want = want[maxNeighbors:] + } + waitNeighbors(want) } func TestUDP_findnodeMultiReply(t *testing.T) {