Skip to content
This repository has been archived by the owner on Jun 19, 2023. It is now read-only.

Commit

Permalink
Merge pull request #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 committed Apr 21, 2020
1 parent 7bbf5bb commit 010f02b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion 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 010f02b

Please sign in to comment.