Skip to content

Commit e2dd0bb

Browse files
committedJul 19, 2015
Merge pull request #1494 from ipfs/fix/dht-test-connect
mark other nodes in routing table on test-connect
2 parents f5b8952 + 6564fae commit e2dd0bb

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed
 

‎routing/dht/dht_test.go

+10
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,16 @@ func connect(t *testing.T, ctx context.Context, a, b *IpfsDHT) {
7878
if err := a.host.Connect(ctx, pi); err != nil {
7979
t.Fatal(err)
8080
}
81+
82+
// loop until connection notification has been received.
83+
// under high load, this may not happen as immediately as we would like.
84+
for a.routingTable.Find(b.self) == "" {
85+
time.Sleep(time.Millisecond * 5)
86+
}
87+
88+
for b.routingTable.Find(a.self) == "" {
89+
time.Sleep(time.Millisecond * 5)
90+
}
8191
}
8292

8393
func bootstrap(t *testing.T, ctx context.Context, dhts []*IpfsDHT) {

0 commit comments

Comments
 (0)
Please sign in to comment.