Content-Length: 281831 | pFad | http://github.com/coder/coder/commit/fb00cd2c1a4fbe19ff1b926f4d4ad0a0a1d44ba7

50 fix(agent/agentcontainers): fix `TestAPI/NoUpdaterLoopLogspam` flake … · coder/coder@fb00cd2 · GitHub
Skip to content

Commit fb00cd2

Browse files
fix(agent/agentcontainers): fix TestAPI/NoUpdaterLoopLogspam flake (#18905)
1 parent aae5fc2 commit fb00cd2

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

agent/agentcontainers/api_test.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,15 +358,22 @@ func TestAPI(t *testing.T) {
358358
fakeCLI = &fakeContainerCLI{
359359
listErr: firstErr,
360360
}
361+
fWatcher = newFakeWatcher(t)
361362
)
362363

363364
api := agentcontainers.NewAPI(logger,
365+
agentcontainers.WithWatcher(fWatcher),
364366
agentcontainers.WithClock(mClock),
365367
agentcontainers.WithContainerCLI(fakeCLI),
366368
)
367369
api.Start()
368370
defer api.Close()
369371

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+
370377
// Make sure the ticker function has been registered
371378
// before advancing the clock.
372379
tickerTrap.MustWait(ctx).MustRelease(ctx)

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/coder/coder/commit/fb00cd2c1a4fbe19ff1b926f4d4ad0a0a1d44ba7

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy