mirror of
https://github.com/ipfs/kubo.git
synced 2026-03-02 14:58:03 +08:00
Merge pull request #1494 from ipfs/fix/dht-test-connect
mark other nodes in routing table on test-connect
This commit is contained in:
commit
e2dd0bb667
@ -78,6 +78,16 @@ func connect(t *testing.T, ctx context.Context, a, b *IpfsDHT) {
|
||||
if err := a.host.Connect(ctx, pi); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
// loop until connection notification has been received.
|
||||
// under high load, this may not happen as immediately as we would like.
|
||||
for a.routingTable.Find(b.self) == "" {
|
||||
time.Sleep(time.Millisecond * 5)
|
||||
}
|
||||
|
||||
for b.routingTable.Find(a.self) == "" {
|
||||
time.Sleep(time.Millisecond * 5)
|
||||
}
|
||||
}
|
||||
|
||||
func bootstrap(t *testing.T, ctx context.Context, dhts []*IpfsDHT) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user