@@ -24,7 +24,7 @@ import (
2424
2525func TestRunServerBase (t * testing.T ) {
2626 params := newTestRunParams ()
27- ctx , cancel := context .WithCancel (context . Background ())
27+ ctx , cancel := context .WithCancel (t . Context ())
2828
2929 rt , err := initRuntime (ctx , params , nil , false )
3030 if err != nil {
@@ -57,7 +57,7 @@ func TestRunServerBaseListenOnLocalhost(t *testing.T) {
5757 params := newTestRunParams ()
5858 params .rt .V1Compatible = true
5959
60- ctx , cancel := context .WithCancel (context . Background ())
60+ ctx , cancel := context .WithCancel (t . Context ())
6161
6262 rt , err := initRuntime (ctx , params , nil , true )
6363 if err != nil {
@@ -98,7 +98,7 @@ func TestRunServerBaseListenOnLocalhost(t *testing.T) {
9898func TestRunServerWithDiagnosticAddr (t * testing.T ) {
9999 params := newTestRunParams ()
100100 params .rt .DiagnosticAddrs = & []string {"localhost:0" }
101- ctx , cancel := context .WithCancel (context . Background ())
101+ ctx , cancel := context .WithCancel (t . Context ())
102102
103103 rt , err := initRuntime (ctx , params , nil , false )
104104 if err != nil {
@@ -141,7 +141,7 @@ func TestInitRuntimeVerifyNonBundle(t *testing.T) {
141141 params .pubKey = "secret"
142142 params .serverMode = false
143143
144- _ , err := initRuntime (context . Background (), params , nil , false )
144+ _ , err := initRuntime (t . Context (), params , nil , false )
145145 if err == nil {
146146 t .Fatal ("Expected error but got nil" )
147147 }
@@ -175,7 +175,7 @@ func TestInitRuntimeCipherSuites(t *testing.T) {
175175 params .cipherSuites = tc .cipherSuites
176176 }
177177
178- rt , err := initRuntime (context . Background (), params , nil , false )
178+ rt , err := initRuntime (t . Context (), params , nil , false )
179179 fmt .Println (err )
180180
181181 if ! tc .expErr && err != nil {
@@ -219,7 +219,7 @@ func TestInitRuntimeSkipKnownSchemaCheck(t *testing.T) {
219219 t .Fatal (err )
220220 }
221221
222- _ , err = initRuntime (context . Background (), params , []string {rootDir }, false )
222+ _ , err = initRuntime (t . Context (), params , []string {rootDir }, false )
223223 if err == nil {
224224 t .Fatal ("Expected error but got nil" )
225225 }
@@ -230,7 +230,7 @@ func TestInitRuntimeSkipKnownSchemaCheck(t *testing.T) {
230230
231231 // skip type checking for known input schemas
232232 params .skipKnownSchemaCheck = true
233- _ , err = initRuntime (context . Background (), params , []string {rootDir }, false )
233+ _ , err = initRuntime (t . Context (), params , []string {rootDir }, false )
234234 if err != nil {
235235 t .Fatal (err )
236236 }
@@ -282,7 +282,7 @@ func TestRunServerUploadPolicy(t *testing.T) {
282282
283283 for i , tc := range tests {
284284 t .Run (tc .note , func (t * testing.T ) {
285- ctx , cancel := context .WithCancel (context . Background ())
285+ ctx , cancel := context .WithCancel (t . Context ())
286286
287287 params := newTestRunParams ()
288288 params .rt .V0Compatible = tc .v0Compatible
@@ -345,7 +345,7 @@ func TestRunServerCheckLogTimestampFormat(t *testing.T) {
345345}
346346
347347func checkLogTimeStampFormat (t * testing.T , params runCmdParams , format string ) {
348- ctx , cancel := context .WithCancel (context . Background ())
348+ ctx , cancel := context .WithCancel (t . Context ())
349349
350350 rt , err := initRuntime (ctx , params , nil , false )
351351 if err != nil {
@@ -417,7 +417,7 @@ func TestInitRuntimeAddrSetByUser(t *testing.T) {
417417
418418 params := newTestRunParams ()
419419 params .rt .Addrs = & []string {"localhost:0" }
420- ctx , cancel := context .WithCancel (context . Background ())
420+ ctx , cancel := context .WithCancel (t . Context ())
421421
422422 rt , err := initRuntime (ctx , params , []string {}, cmd .Flags ().Changed ("addr" ))
423423 if err != nil {
0 commit comments