Skip to content

Commit

Permalink
Merge pull request #25 from libp2p/gx/publish-1.7.0
Browse files Browse the repository at this point in the history
Release 1.7.0
  • Loading branch information
Stebalien committed Jul 20, 2017
2 parents 2dfcd80 + 4333b4c commit 527805d
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions p2p/net/swarm/swarm_notif_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ func streamsSame(a, b inet.Stream) bool {
}

func TestNotifications(t *testing.T) {
const swarmSize = 5

ctx := context.Background()
swarms := makeSwarms(ctx, t, 5)
swarms := makeSwarms(ctx, t, swarmSize)
defer func() {
for _, s := range swarms {
s.Close()
Expand All @@ -30,7 +32,7 @@ func TestNotifications(t *testing.T) {
// signup notifs
notifiees := make([]*netNotifiee, len(swarms))
for i, swarm := range swarms {
n := newNetNotifiee()
n := newNetNotifiee(swarmSize)
swarm.Notify(n)
notifiees[i] = n
}
Expand Down Expand Up @@ -184,14 +186,14 @@ type netNotifiee struct {
closedStream chan inet.Stream
}

func newNetNotifiee() *netNotifiee {
func newNetNotifiee(buffer int) *netNotifiee {
return &netNotifiee{
listen: make(chan ma.Multiaddr),
listenClose: make(chan ma.Multiaddr),
connected: make(chan inet.Conn),
disconnected: make(chan inet.Conn),
openedStream: make(chan inet.Stream),
closedStream: make(chan inet.Stream),
listen: make(chan ma.Multiaddr, buffer),
listenClose: make(chan ma.Multiaddr, buffer),
connected: make(chan inet.Conn, buffer),
disconnected: make(chan inet.Conn, buffer),
openedStream: make(chan inet.Stream, buffer),
closedStream: make(chan inet.Stream, buffer),
}
}

Expand Down

0 comments on commit 527805d

Please sign in to comment.