mirror of
https://github.com/coder/coder.git
synced 2025-07-15 22:20:27 +00:00
fix(codersdk/agentsdk): improve ctx cancel in agent logs flush, fix test (#10214)
Fixes #9719 Related #9865
This commit is contained in:
committed by
GitHub
parent
a1ee4d44aa
commit
a2cd6640f3
@ -344,7 +344,9 @@ func TestStartupLogsSender(t *testing.T) {
|
||||
return nil
|
||||
}
|
||||
|
||||
sendLog, flushAndClose := agentsdk.LogsSender(uuid.New(), patchLogs, slogtest.Make(t, nil).Leveled(slog.LevelDebug))
|
||||
// Prevent race between auto-flush and context cancellation with
|
||||
// a really long timeout.
|
||||
sendLog, flushAndClose := agentsdk.LogsSender(uuid.New(), patchLogs, slogtest.Make(t, nil).Leveled(slog.LevelDebug), agentsdk.LogsSenderFlushTimeout(time.Hour))
|
||||
defer func() {
|
||||
_ = flushAndClose(ctx)
|
||||
}()
|
||||
|
Reference in New Issue
Block a user