Skip to content

Commit

Permalink
Merge pull request ipfs/interface-go-ipfs-core#61 from ipfs/fix/dht-wait
Browse files Browse the repository at this point in the history
extra time for dht spin-up

This commit was moved from ipfs/interface-go-ipfs-core@835aca2
  • Loading branch information
Stebalien authored Apr 21, 2020
2 parents a9c9bff + a7c6631 commit 49f0656
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion coreapi/iface/tests/dht.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import (
"context"
"io"
"testing"
"time"

"github.com/ipfs/interface-go-ipfs-core"
iface "github.com/ipfs/interface-go-ipfs-core"
"github.com/ipfs/interface-go-ipfs-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 @@ -88,6 +91,8 @@ func (tp *TestSuite) TestDhtFindProviders(t *testing.T) {
t.Fatal(err)
}

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 Expand Up @@ -125,6 +130,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 49f0656

Please sign in to comment.