Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
willscott committed Apr 9, 2020
1 parent ab21555 commit 02d310f
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions dual/dual_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import (
u "github.com/ipfs/go-ipfs-util"
"github.com/libp2p/go-libp2p-core/network"
"github.com/libp2p/go-libp2p-core/peer"
peerstore "github.com/libp2p/go-libp2p-core/peerstore"
dht "github.com/libp2p/go-libp2p-kad-dht"
test "github.com/libp2p/go-libp2p-kad-dht/internal/testing"
peerstore "github.com/libp2p/go-libp2p-peerstore"
record "github.com/libp2p/go-libp2p-record"
swarmt "github.com/libp2p/go-libp2p-swarm/testing"
bhost "github.com/libp2p/go-libp2p/p2p/host/basic"
Expand Down Expand Up @@ -189,6 +189,8 @@ func TestFindProviderAsync(t *testing.T) {
defer wan.Close()
defer lan.Close()

time.Sleep(5 * time.Millisecond)

if err := wan.Provide(ctx, wancid, false); err != nil {
t.Fatal(err)
}
Expand Down Expand Up @@ -227,6 +229,8 @@ func TestValueGetSet(t *testing.T) {
defer wan.Close()
defer lan.Close()

time.Sleep(5 * time.Millisecond)

err := d.PutValue(ctx, "/v/hello", []byte("valid"))
if err != nil {
t.Fatal(err)
Expand All @@ -239,7 +243,7 @@ func TestValueGetSet(t *testing.T) {
t.Fatal("failed to get expected string.")
}

val, err = lan.GetValue(ctx, "/v/hello")
_, err = lan.GetValue(ctx, "/v/hello")
if err == nil {
t.Fatal(err)
}
Expand All @@ -257,7 +261,7 @@ func TestSearchValue(t *testing.T) {
d.WAN.Validator.(record.NamespacedValidator)["v"] = test.TestValidator{}
d.LAN.Validator.(record.NamespacedValidator)["v"] = test.TestValidator{}

err := wan.PutValue(ctx, "/v/hello", []byte("valid"))
_ = wan.PutValue(ctx, "/v/hello", []byte("valid"))

valCh, err := d.SearchValue(ctx, "/v/hello", dht.Quorum(0))
if err != nil {
Expand Down Expand Up @@ -310,6 +314,8 @@ func TestGetPublicKey(t *testing.T) {
defer wan.Close()
defer lan.Close()

time.Sleep(5 * time.Millisecond)

pk, err := d.GetPublicKey(ctx, wan.PeerID())
if err != nil {
t.Fatal(err)
Expand Down Expand Up @@ -344,6 +350,8 @@ func TestFindPeer(t *testing.T) {
defer wan.Close()
defer lan.Close()

time.Sleep(5 * time.Millisecond)

p, err := d.FindPeer(ctx, lan.PeerID())
if err != nil {
t.Fatal(err)
Expand Down

0 comments on commit 02d310f

Please sign in to comment.