@@ -18,7 +18,6 @@ limitations under the License.
1818package  standalone_test
1919
2020import  (
21- 	"context" 
2221	"fmt" 
2322	"io/ioutil" 
2423	"path/filepath" 
@@ -58,9 +57,7 @@ func TestRunWithTemplateFile(t *testing.T) {
5857		args  :=  []string {
5958			"-f" , runFilePath ,
6059		}
61- 		ctx , cancel  :=  context .WithTimeout (context .Background (), 10 * time .Second )
62- 		defer  cancel ()
63- 		output , err  :=  cmdRunWithContext (ctx , "" , args ... )
60+ 		output , err  :=  cmdRunWithContext (t .Context (), "" , args ... )
6461		t .Logf ("%s" , output )
6562		require .NoError (t , err , "run failed" )
6663		// Deterministic output for template file, so we can assert line by line 
@@ -107,9 +104,7 @@ func TestRunWithTemplateFile(t *testing.T) {
107104		args  :=  []string {
108105			"-f" , runFilePath ,
109106		}
110- 		ctx , cancel  :=  context .WithTimeout (context .Background (), 10 * time .Second )
111- 		defer  cancel ()
112- 		output , err  :=  cmdRunWithContext (ctx , "" , args ... )
107+ 		output , err  :=  cmdRunWithContext (t .Context (), "" , args ... )
113108		t .Logf ("%s" , output )
114109		require .NoError (t , err , "run failed" )
115110		// Deterministic output for template file, so we can assert line by line 
@@ -163,9 +158,7 @@ func TestRunWithTemplateFile(t *testing.T) {
163158		args  :=  []string {
164159			"-f" , runFilePath ,
165160		}
166- 		ctx , cancel  :=  context .WithTimeout (context .Background (), 10 * time .Second )
167- 		defer  cancel ()
168- 		output , err  :=  cmdRunWithContext (ctx , "" , args ... )
161+ 		output , err  :=  cmdRunWithContext (t .Context (), "" , args ... )
169162		t .Logf ("%s" , output )
170163		require .NoError (t , err , "run failed" )
171164		// Deterministic output for template file, so we can assert line by line 
@@ -213,9 +206,7 @@ func TestRunWithTemplateFile(t *testing.T) {
213206		args  :=  []string {
214207			"-f" , runFilePath ,
215208		}
216- 		ctx , cancel  :=  context .WithTimeout (context .Background (), 10 * time .Second )
217- 		defer  cancel ()
218- 		output , err  :=  cmdRunWithContext (ctx , "" , args ... )
209+ 		output , err  :=  cmdRunWithContext (t .Context (), "" , args ... )
219210		t .Logf ("%s" , output )
220211		require .NoError (t , err , "run failed" )
221212		// Deterministic output for template file, so we can assert line by line 
@@ -264,9 +255,7 @@ func TestRunWithTemplateFile(t *testing.T) {
264255		args  :=  []string {
265256			"-f" , runFilePath ,
266257		}
267- 		ctx , cancel  :=  context .WithTimeout (context .Background (), 10 * time .Second )
268- 		defer  cancel ()
269- 		output , err  :=  cmdRunWithContext (ctx , "" , args ... )
258+ 		output , err  :=  cmdRunWithContext (t .Context (), "" , args ... )
270259		t .Logf ("%s" , output )
271260		require .Error (t , err , "run must fail" )
272261		// Deterministic output for template file, so we can assert line by line 
@@ -312,9 +301,7 @@ func TestRunWithTemplateFile(t *testing.T) {
312301		args  :=  []string {
313302			"-f" , runFilePath ,
314303		}
315- 		ctx , cancel  :=  context .WithTimeout (context .Background (), 10 * time .Second )
316- 		defer  cancel ()
317- 		output , err  :=  cmdRunWithContext (ctx , "" , args ... )
304+ 		output , err  :=  cmdRunWithContext (t .Context (), "" , args ... )
318305		t .Logf ("%s" , output )
319306		require .NoError (t , err , "run failed" )
320307
@@ -371,9 +358,7 @@ func TestRunTemplateFileWithoutDaprInit(t *testing.T) {
371358		args  :=  []string {
372359			"-f" , "../testdata/run-template-files/no_app_command.yaml" ,
373360		}
374- 		ctx , cancel  :=  context .WithTimeout (context .Background (), 10 * time .Second )
375- 		defer  cancel ()
376- 		output , err  :=  cmdRunWithContext (ctx , "" , args ... )
361+ 		output , err  :=  cmdRunWithContext (t .Context (), "" , args ... )
377362		t .Logf ("%s" , output )
378363		require .Error (t , err , "run must fail" )
379364		assert .Contains (t , output , "Error starting Dapr and app (\" processor\" ): fork/exec" )
0 commit comments