Skip to content

Commit

Permalink
Merge pull request ipfs#61 from ipfs/fix/dht-wait
Browse files Browse the repository at this point in the history
extra time for dht spin-up
  • Loading branch information
Stebalien authored and Robin committed Aug 19, 2020
1 parent 3605d23 commit 4192351
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/dht.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"io"
"testing"
"time"

"github.com/TRON-US/interface-go-btfs-core"
"github.com/TRON-US/interface-go-btfs-core/options"
Expand Down Expand Up @@ -43,6 +44,8 @@ func (tp *TestSuite) TestDhtFindPeer(t *testing.T) {
t.Fatal("unexpected number of local addrs")
}

time.Sleep(3 * time.Second)

pi, err := apis[2].Dht().FindPeer(ctx, self0.ID())
if err != nil {
t.Fatal(err)
Expand Down Expand Up @@ -125,6 +128,8 @@ func (tp *TestSuite) TestDhtProvide(t *testing.T) {

p := s.Path()

time.Sleep(3 * time.Second)

out, err := apis[2].Dht().FindProviders(ctx, p, options.Dht.NumProviders(1))
if err != nil {
t.Fatal(err)
Expand Down

0 comments on commit 4192351

Please sign in to comment.