Skip to content

Commit

Permalink
Merge pull request #31 from libp2p/open-stream-context
Browse files Browse the repository at this point in the history
pass contexts to OpenStream in tests
  • Loading branch information
marten-seemann authored Dec 19, 2020
2 parents c18bd50 + 59f8133 commit a3d1008
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions p2p/transport/testsuite/stream_suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ func SubtestStress(t *testing.T, ta, tb transport.Transport, maddr ma.Multiaddr,
openStreamAndRW := func(c mux.MuxedConn) {
debugLog(t, "openStreamAndRW %p, %d opt.MsgNum", c, opt.MsgNum)

s, err := c.OpenStream()
s, err := c.OpenStream(context.Background())
if err != nil {
errs <- fmt.Errorf("Failed to create NewStream: %s", err)
return
Expand Down Expand Up @@ -329,7 +329,7 @@ func SubtestStreamOpenStress(t *testing.T, ta, tb transport.Transport, maddr ma.
go func() {
defer wg.Done()
for i := 0; i < count; i++ {
s, err := connA.OpenStream()
s, err := connA.OpenStream(context.Background())
if err != nil {
t.Error(err)
return
Expand Down Expand Up @@ -384,7 +384,7 @@ func SubtestStreamReset(t *testing.T, ta, tb transport.Transport, maddr ma.Multi
muxa, err := l.Accept()
checkErr(t, err)

s, err := muxa.OpenStream()
s, err := muxa.OpenStream(context.Background())
if err != nil {
panic(err)
}
Expand Down
4 changes: 2 additions & 2 deletions p2p/transport/testsuite/transport_suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ func SubtestBasic(t *testing.T, ta, tb transport.Transport, maddr ma.Multiaddr,
t.Fatal(err)
}

s, err := connA.OpenStream()
s, err := connA.OpenStream(context.Background())
if err != nil {
t.Fatal(err)
}
Expand Down Expand Up @@ -243,7 +243,7 @@ func SubtestPingPong(t *testing.T, ta, tb transport.Transport, maddr ma.Multiadd
}

for i := 0; i < streams; i++ {
s, err := connB.OpenStream()
s, err := connB.OpenStream(context.Background())
if err != nil {
t.Error(err)
continue
Expand Down

0 comments on commit a3d1008

Please sign in to comment.