p2p/discover: fix test error messages (#29592)

pull/29602/head
bugmaker9371 7 months ago committed by GitHub
parent 2e06fbd409
commit 98f504f69f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      p2p/discover/v4_udp_test.go

@ -282,12 +282,12 @@ func TestUDPv4_findnode(t *testing.T) {
waitNeighbors := func(want []*node) {
test.waitPacketOut(func(p *v4wire.Neighbors, to *net.UDPAddr, hash []byte) {
if len(p.Nodes) != len(want) {
t.Errorf("wrong number of results: got %d, want %d", len(p.Nodes), bucketSize)
t.Errorf("wrong number of results: got %d, want %d", len(p.Nodes), len(want))
return
}
for i, n := range p.Nodes {
if n.ID.ID() != want[i].ID() {
t.Errorf("result mismatch at %d:\n got: %v\n want: %v", i, n, expected.entries[i])
t.Errorf("result mismatch at %d:\n got: %v\n want: %v", i, n, expected.entries[i])
}
if !live[n.ID.ID()] {
t.Errorf("result includes dead node %v", n.ID.ID())

Loading…
Cancel
Save