1
1
package runtime
2
2
3
3
import (
4
- "context"
5
4
"reflect"
6
5
"testing"
7
6
"time"
@@ -57,9 +56,7 @@ func TestSingleRuntime_ShowCerts(t *testing.T) {
57
56
t .Run (tt .name , func (t * testing.T ) {
58
57
haProxy .SetResponses (& tt .socketResponse )
59
58
s := & SingleRuntime {}
60
- ctx , cancel := context .WithTimeout (context .Background (), time .Duration (time .Second ))
61
- defer cancel ()
62
- err := s .Init (ctx , tt .fields .socketPath , tt .fields .process , tt .fields .worker )
59
+ err := s .Init (tt .fields .socketPath , tt .fields .process , tt .fields .worker )
63
60
if err != nil {
64
61
t .Errorf ("SingleRuntime.Init() error = %v" , err )
65
62
return
@@ -148,9 +145,7 @@ func TestSingleRuntime_GetCert(t *testing.T) {
148
145
t .Run (tt .name , func (t * testing.T ) {
149
146
haProxy .SetResponses (& tt .socketResponse )
150
147
s := & SingleRuntime {}
151
- ctx , cancel := context .WithTimeout (context .Background (), time .Duration (time .Second ))
152
- defer cancel ()
153
- err := s .Init (ctx , tt .fields .socketPath , tt .fields .process , tt .fields .worker )
148
+ err := s .Init (tt .fields .socketPath , tt .fields .process , tt .fields .worker )
154
149
if err != nil {
155
150
t .Errorf ("SingleRuntime.Init() error = %v" , err )
156
151
return
@@ -234,9 +229,7 @@ func TestSingleRuntime_ShowCertEntry(t *testing.T) {
234
229
t .Run (tt .name , func (t * testing.T ) {
235
230
haProxy .SetResponses (& tt .socketResponse )
236
231
s := & SingleRuntime {}
237
- ctx , cancel := context .WithTimeout (context .Background (), time .Duration (time .Second ))
238
- defer cancel ()
239
- err := s .Init (ctx , tt .fields .socketPath , tt .fields .process , tt .fields .worker )
232
+ err := s .Init (tt .fields .socketPath , tt .fields .process , tt .fields .worker )
240
233
if err != nil {
241
234
t .Errorf ("SingleRuntime.Init() error = %v" , err )
242
235
return
@@ -259,7 +252,6 @@ func TestSingleRuntime_NewCertEntry(t *testing.T) {
259
252
defer haProxy .Stop ()
260
253
261
254
type fields struct {
262
- jobs chan Task
263
255
socketPath string
264
256
worker int
265
257
process int
@@ -312,9 +304,7 @@ func TestSingleRuntime_NewCertEntry(t *testing.T) {
312
304
t .Run (tt .name , func (t * testing.T ) {
313
305
haProxy .SetResponses (& tt .socketResponse )
314
306
s := & SingleRuntime {}
315
- ctx , cancel := context .WithTimeout (context .Background (), time .Duration (time .Second ))
316
- defer cancel ()
317
- err := s .Init (ctx , tt .fields .socketPath , tt .fields .process , tt .fields .worker )
307
+ err := s .Init (tt .fields .socketPath , tt .fields .process , tt .fields .worker )
318
308
if err != nil {
319
309
t .Errorf ("SingleRuntime.Init() error = %v" , err )
320
310
return
@@ -332,7 +322,6 @@ func TestSingleRuntime_SetCertEntry(t *testing.T) {
332
322
defer haProxy .Stop ()
333
323
334
324
type fields struct {
335
- jobs chan Task
336
325
socketPath string
337
326
worker int
338
327
process int
@@ -401,9 +390,7 @@ func TestSingleRuntime_SetCertEntry(t *testing.T) {
401
390
t .Run (tt .name , func (t * testing.T ) {
402
391
haProxy .SetResponses (& tt .socketResponse )
403
392
s := & SingleRuntime {}
404
- ctx , cancel := context .WithTimeout (context .Background (), time .Duration (time .Second ))
405
- defer cancel ()
406
- err := s .Init (ctx , tt .fields .socketPath , tt .fields .process , tt .fields .worker )
393
+ err := s .Init (tt .fields .socketPath , tt .fields .process , tt .fields .worker )
407
394
if err != nil {
408
395
t .Errorf ("SingleRuntime.Init() error = %v" , err )
409
396
return
@@ -421,7 +408,6 @@ func TestSingleRuntime_CommitCertEntry(t *testing.T) {
421
408
defer haProxy .Stop ()
422
409
423
410
type fields struct {
424
- jobs chan Task
425
411
socketPath string
426
412
worker int
427
413
process int
@@ -476,9 +462,7 @@ func TestSingleRuntime_CommitCertEntry(t *testing.T) {
476
462
t .Run (tt .name , func (t * testing.T ) {
477
463
haProxy .SetResponses (& tt .socketResponse )
478
464
s := & SingleRuntime {}
479
- ctx , cancel := context .WithTimeout (context .Background (), time .Duration (time .Second ))
480
- defer cancel ()
481
- err := s .Init (ctx , tt .fields .socketPath , tt .fields .process , tt .fields .worker )
465
+ err := s .Init (tt .fields .socketPath , tt .fields .process , tt .fields .worker )
482
466
if err != nil {
483
467
t .Errorf ("SingleRuntime.Init() error = %v" , err )
484
468
return
@@ -496,7 +480,6 @@ func TestSingleRuntime_AbortCertEntry(t *testing.T) {
496
480
defer haProxy .Stop ()
497
481
498
482
type fields struct {
499
- jobs chan Task
500
483
socketPath string
501
484
worker int
502
485
process int
@@ -549,9 +532,7 @@ func TestSingleRuntime_AbortCertEntry(t *testing.T) {
549
532
t .Run (tt .name , func (t * testing.T ) {
550
533
haProxy .SetResponses (& tt .socketResponse )
551
534
s := & SingleRuntime {}
552
- ctx , cancel := context .WithTimeout (context .Background (), time .Duration (time .Second ))
553
- defer cancel ()
554
- err := s .Init (ctx , tt .fields .socketPath , tt .fields .process , tt .fields .worker )
535
+ err := s .Init (tt .fields .socketPath , tt .fields .process , tt .fields .worker )
555
536
if err != nil {
556
537
t .Errorf ("SingleRuntime.Init() error = %v" , err )
557
538
return
@@ -569,7 +550,6 @@ func TestSingleRuntime_DeleteCertEntry(t *testing.T) {
569
550
defer haProxy .Stop ()
570
551
571
552
type fields struct {
572
- jobs chan Task
573
553
socketPath string
574
554
worker int
575
555
process int
@@ -622,9 +602,7 @@ func TestSingleRuntime_DeleteCertEntry(t *testing.T) {
622
602
t .Run (tt .name , func (t * testing.T ) {
623
603
haProxy .SetResponses (& tt .socketResponse )
624
604
s := & SingleRuntime {}
625
- ctx , cancel := context .WithTimeout (context .Background (), time .Duration (time .Second ))
626
- defer cancel ()
627
- err := s .Init (ctx , tt .fields .socketPath , tt .fields .process , tt .fields .worker )
605
+ err := s .Init (tt .fields .socketPath , tt .fields .process , tt .fields .worker )
628
606
if err != nil {
629
607
t .Errorf ("SingleRuntime.Init() error = %v" , err )
630
608
return
0 commit comments