test(coderd): close metricscache and avoid background context (#7996)

This commit is contained in:
Mathias Fredriksson
2023-06-13 20:18:31 +03:00
committed by GitHub
parent 2e7e99b135
commit 51226c55ab
6 changed files with 33 additions and 7 deletions
+1
View File
@@ -435,6 +435,7 @@ func TestCache_DeploymentStats(t *testing.T) {
cache := metricscache.New(db, slogtest.Make(t, nil), metricscache.Intervals{
DeploymentStats: testutil.IntervalFast,
})
defer cache.Close()
_, err := db.InsertWorkspaceAgentStat(context.Background(), database.InsertWorkspaceAgentStatParams{
ID: uuid.New(),