Skip to content

Commit a6a239f

Browse files
committed
test: fix TestNotFound bootstrapping
1 parent 5111cf8 commit a6a239f

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

ext_test.go

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -232,10 +232,6 @@ func TestNotFound(t *testing.T) {
232232
t.Fatal(err)
233233
}
234234

235-
for _, p := range hosts {
236-
d.peerFound(ctx, p.ID(), true)
237-
}
238-
239235
// Reply with random peers to every message
240236
for _, host := range hosts {
241237
host := host // shadow loop var
@@ -271,6 +267,16 @@ func TestNotFound(t *testing.T) {
271267
}
272268
})
273269
}
270+
for _, peer := range hosts {
271+
if host == peer {
272+
continue
273+
}
274+
_ = peer.Peerstore().AddProtocols(host.ID(), protocol.ConvertToStrings(d.serverProtocols)...)
275+
}
276+
}
277+
278+
for _, p := range hosts {
279+
d.peerFound(ctx, p.ID(), true)
274280
}
275281

276282
// long timeout to ensure timing is not at play.

0 commit comments

Comments
 (0)