From 59f8133627fca5df680d003763bab598a600ab17 Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Thu, 17 Dec 2020 16:42:55 +0700 Subject: [PATCH] pass contexts to OpenStream in tests --- p2p/transport/testsuite/stream_suite.go | 6 +++--- p2p/transport/testsuite/transport_suite.go | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/p2p/transport/testsuite/stream_suite.go b/p2p/transport/testsuite/stream_suite.go index e04deaeb6..f7172b463 100644 --- a/p2p/transport/testsuite/stream_suite.go +++ b/p2p/transport/testsuite/stream_suite.go @@ -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 @@ -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 @@ -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) } diff --git a/p2p/transport/testsuite/transport_suite.go b/p2p/transport/testsuite/transport_suite.go index eef75bfbc..234c43c49 100644 --- a/p2p/transport/testsuite/transport_suite.go +++ b/p2p/transport/testsuite/transport_suite.go @@ -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) } @@ -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