@@ -59,6 +59,7 @@ func TestVarsManagerError(t *testing.T) {
59
59
managerChans : managerChans {
60
60
varsManagerError : varsErrorChan ,
61
61
},
62
+ componentPIDTicker : time .NewTicker (time .Second * 30 ),
62
63
}
63
64
// Send an error via the vars manager channel, and let Coordinator update
64
65
const errorStr = "force error"
@@ -110,6 +111,7 @@ func TestCoordinatorReportsUnhealthyComponents(t *testing.T) {
110
111
managerChans : managerChans {
111
112
runtimeManagerUpdate : runtimeChan ,
112
113
},
114
+ componentPIDTicker : time .NewTicker (time .Second * 30 ),
113
115
}
114
116
115
117
unhealthyComponent := runtime.ComponentComponentState {
@@ -186,6 +188,7 @@ func TestCoordinatorComponentStatesAreSeparate(t *testing.T) {
186
188
managerChans : managerChans {
187
189
runtimeManagerUpdate : runtimeChan ,
188
190
},
191
+ componentPIDTicker : time .NewTicker (time .Second * 30 ),
189
192
}
190
193
191
194
comp1 := runtime.ComponentComponentState {
@@ -256,6 +259,7 @@ func TestCoordinatorReportsUnhealthyUnits(t *testing.T) {
256
259
managerChans : managerChans {
257
260
runtimeManagerUpdate : runtimeChan ,
258
261
},
262
+ componentPIDTicker : time .NewTicker (time .Second * 30 ),
259
263
}
260
264
261
265
// Create a healthy component with healthy input and output units
@@ -375,8 +379,9 @@ func TestCoordinatorReportsInvalidPolicy(t *testing.T) {
375
379
runtimeMgr : & fakeRuntimeManager {},
376
380
377
381
// Set valid but empty initial values for ast and vars
378
- vars : emptyVars (t ),
379
- ast : emptyAST (t ),
382
+ vars : emptyVars (t ),
383
+ ast : emptyAST (t ),
384
+ componentPIDTicker : time .NewTicker (time .Second * 30 ),
380
385
}
381
386
382
387
// Send an invalid config update and confirm that Coordinator reports
@@ -389,7 +394,6 @@ agent.download.sourceURI:
389
394
cfgChange := & configChange {cfg : cfg }
390
395
configChan <- cfgChange
391
396
coord .runLoopIteration (ctx )
392
-
393
397
assert .True (t , cfgChange .failed , "Policy with invalid field should have reported failed config change" )
394
398
require .ErrorContainsf (t ,
395
399
cfgChange .err ,
@@ -420,6 +424,7 @@ agent.download.sourceURI:
420
424
// (This check is based on a previous bug in which a vars update could
421
425
// discard active policy errors.)
422
426
varsChan <- emptyVars (t )
427
+ t .Logf ("after emptyVars statement" )
423
428
coord .runLoopIteration (ctx )
424
429
425
430
assert .Error (t , coord .configErr , "Vars update shouldn't affect configErr" )
@@ -489,8 +494,9 @@ func TestCoordinatorReportsComponentModelError(t *testing.T) {
489
494
runtimeMgr : & fakeRuntimeManager {},
490
495
491
496
// Set valid but empty initial values for ast and vars
492
- vars : emptyVars (t ),
493
- ast : emptyAST (t ),
497
+ vars : emptyVars (t ),
498
+ ast : emptyAST (t ),
499
+ componentPIDTicker : time .NewTicker (time .Second * 30 ),
494
500
}
495
501
496
502
// This configuration produces a valid AST but its EQL condition is
@@ -583,8 +589,9 @@ func TestCoordinatorPolicyChangeUpdatesMonitorReloader(t *testing.T) {
583
589
managerChans : managerChans {
584
590
configManagerUpdate : configChan ,
585
591
},
586
- runtimeMgr : runtimeManager ,
587
- vars : emptyVars (t ),
592
+ runtimeMgr : runtimeManager ,
593
+ vars : emptyVars (t ),
594
+ componentPIDTicker : time .NewTicker (time .Second * 30 ),
588
595
}
589
596
coord .RegisterMonitoringServer (monitoringReloader )
590
597
@@ -711,8 +718,9 @@ func TestCoordinatorPolicyChangeUpdatesRuntimeManager(t *testing.T) {
711
718
managerChans : managerChans {
712
719
configManagerUpdate : configChan ,
713
720
},
714
- runtimeMgr : runtimeManager ,
715
- vars : emptyVars (t ),
721
+ runtimeMgr : runtimeManager ,
722
+ vars : emptyVars (t ),
723
+ componentPIDTicker : time .NewTicker (time .Second * 30 ),
716
724
}
717
725
718
726
// Create a policy with one input and one output
@@ -798,8 +806,9 @@ func TestCoordinatorReportsRuntimeManagerUpdateFailure(t *testing.T) {
798
806
// manager, so it receives the update result.
799
807
runtimeManagerError : updateErrChan ,
800
808
},
801
- runtimeMgr : runtimeManager ,
802
- vars : emptyVars (t ),
809
+ runtimeMgr : runtimeManager ,
810
+ vars : emptyVars (t ),
811
+ componentPIDTicker : time .NewTicker (time .Second * 30 ),
803
812
}
804
813
805
814
// Send an empty policy which should forward an empty component model to
@@ -860,8 +869,9 @@ func TestCoordinatorAppliesVarsToPolicy(t *testing.T) {
860
869
configManagerUpdate : configChan ,
861
870
varsManagerUpdate : varsChan ,
862
871
},
863
- runtimeMgr : runtimeManager ,
864
- vars : emptyVars (t ),
872
+ runtimeMgr : runtimeManager ,
873
+ vars : emptyVars (t ),
874
+ componentPIDTicker : time .NewTicker (time .Second * 30 ),
865
875
}
866
876
867
877
// Create a policy with one input and one output
@@ -936,7 +946,8 @@ func TestCoordinatorReportsOverrideState(t *testing.T) {
936
946
stateBroadcaster : & broadcaster.Broadcaster [State ]{
937
947
InputChan : stateChan ,
938
948
},
939
- overrideStateChan : overrideStateChan ,
949
+ overrideStateChan : overrideStateChan ,
950
+ componentPIDTicker : time .NewTicker (time .Second * 30 ),
940
951
}
941
952
// Send an error via the vars manager channel, and let Coordinator update
942
953
overrideStateChan <- & coordinatorOverrideState {
0 commit comments