File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -358,15 +358,22 @@ func TestAPI(t *testing.T) {
358
358
fakeCLI = & fakeContainerCLI {
359
359
listErr : firstErr ,
360
360
}
361
+ fWatcher = newFakeWatcher (t )
361
362
)
362
363
363
364
api := agentcontainers .NewAPI (logger ,
365
+ agentcontainers .WithWatcher (fWatcher ),
364
366
agentcontainers .WithClock (mClock ),
365
367
agentcontainers .WithContainerCLI (fakeCLI ),
366
368
)
367
369
api .Start ()
368
370
defer api .Close ()
369
371
372
+ // The watcherLoop writes a log when it is initialized.
373
+ // We want to ensure this has happened before we start
374
+ // the test so that it does not intefere.
375
+ fWatcher .waitNext (ctx )
376
+
370
377
// Make sure the ticker function has been registered
371
378
// before advancing the clock.
372
379
tickerTrap .MustWait (ctx ).MustRelease (ctx )
You can’t perform that action at this time.
0 commit comments