Skip to content

Commit

Permalink
Merge pull request ipfs/kubo#9023 from ipfs/release-v0.13.0
Browse files Browse the repository at this point in the history
Release v0.13.0

This commit was moved from ipfs/kubo@c9d51bb
  • Loading branch information
guseggert committed Jun 9, 2022
2 parents ae68387 + 662566b commit 440c583
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions peering/peering_test.go
Expand Up @@ -6,20 +6,22 @@ import (
"time"

"github.com/libp2p/go-libp2p"
connmgr "github.com/libp2p/go-libp2p-connmgr"
"github.com/libp2p/go-libp2p-core/host"
"github.com/libp2p/go-libp2p-core/network"
"github.com/libp2p/go-libp2p-core/peer"
"github.com/libp2p/go-libp2p/p2p/net/connmgr"

"github.com/stretchr/testify/require"
)

func newNode(ctx context.Context, t *testing.T) host.Host {
func newNode(t *testing.T) host.Host {
cm, err := connmgr.NewConnManager(1, 100, connmgr.WithGracePeriod(0))
require.NoError(t, err)
h, err := libp2p.New(
libp2p.ListenAddrStrings("/ip4/127.0.0.1/tcp/0"),
// We'd like to set the connection manager low water to 0, but
// that would disable the connection manager.
libp2p.ConnectionManager(connmgr.NewConnManager(1, 100, 0)),
libp2p.ConnectionManager(cm),
)
require.NoError(t, err)
return h
Expand All @@ -29,12 +31,12 @@ func TestPeeringService(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()

h1 := newNode(ctx, t)
h1 := newNode(t)
ps1 := NewPeeringService(h1)

h2 := newNode(ctx, t)
h3 := newNode(ctx, t)
h4 := newNode(ctx, t)
h2 := newNode(t)
h3 := newNode(t)
h4 := newNode(t)

// peer 1 -> 2
ps1.AddPeer(peer.AddrInfo{ID: h2.ID(), Addrs: h2.Addrs()})
Expand Down

0 comments on commit 440c583

Please sign in to comment.