Skip to content

Commit

Permalink
chore: fix bad merge
Browse files Browse the repository at this point in the history
  • Loading branch information
postables committed Jul 30, 2019
1 parent 1adede3 commit d695edc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion connmgr.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ func (cm *BasicConnMgr) getConnsToClose(ctx context.Context) []network.Conn {
cm.plk.RUnlock()

if ncandidates < cm.lowWater {
log.Info("open connection count above limit but too many are in the grace period")
cm.logger.Info("open connection count above limit but too many are in the grace period")
// We have too many connections but fewer than lowWater
// connections out of the grace period.
//
Expand Down
11 changes: 6 additions & 5 deletions connmgr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (
tu "github.com/libp2p/go-libp2p-core/test"
ma "github.com/multiformats/go-multiaddr"
"go.uber.org/zap/zaptest"

)

type tconn struct {
Expand Down Expand Up @@ -50,7 +49,7 @@ func randConn(t testing.TB, discNotify func(network.Network, network.Conn)) netw
return &tconn{peer: pid, disconnectNotify: discNotify}
}

func TestConnTrimming(t *testing.T) {
func TestConnTrimming(t *testing.T) {
wg := &sync.WaitGroup{}
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
Expand Down Expand Up @@ -334,9 +333,11 @@ func TestGracePeriod(t *testing.T) {
if detectrace.WithRace() {
t.Skip("race detector is unhappy with this test")
}

wg := &sync.WaitGroup{}
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
SilencePeriod = 0
cm := NewConnManager(10, 20, 100*time.Millisecond)
cm := NewConnManager(ctx, wg, zaptest.NewLogger(t), 10, 20, 100*time.Millisecond)
SilencePeriod = 10 * time.Second

not := cm.Notifee()
Expand Down Expand Up @@ -706,7 +707,7 @@ func TestTemporaryEntryConvertedOnConnection(t *testing.T) {
wg := &sync.WaitGroup{}
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
cm := NewConnManager(ctx, wg,zaptest.NewLogger(t), 1, 1, 0)
cm := NewConnManager(ctx, wg, zaptest.NewLogger(t), 1, 1, 0)

conn := randConn(t, nil)
cm.TagPeer(conn.RemotePeer(), "test", 20)
Expand Down

0 comments on commit d695edc

Please sign in to comment.