From 0022ad1497c3a038a442ef248ac8d67d33d195de Mon Sep 17 00:00:00 2001 From: Kyle Carberry Date: Tue, 7 Mar 2023 03:57:39 +0000 Subject: [PATCH] chore: fix stats leaking in tests See https://github.com/coder/coder/actions/runs/4350254306/jobs/7601134509 --- agent/agent.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/agent/agent.go b/agent/agent.go index 453f810013aa4..daaf2beb7b6e7 100644 --- a/agent/agent.go +++ b/agent/agent.go @@ -122,7 +122,9 @@ func New(options Options) io.Closer { tempDir: options.TempDir, lifecycleUpdate: make(chan struct{}, 1), lifecycleReported: make(chan codersdk.WorkspaceAgentLifecycle, 1), - connStatsChan: make(chan *agentsdk.Stats, 1), + // TODO: This is a temporary hack to make tests not flake. + // @kylecarbs has a better solution in here: https://github.com/coder/coder/pull/6469 + connStatsChan: make(chan *agentsdk.Stats, 8), } a.init(ctx) return a