Skip to content

Commit fd3628f

Browse files
committed
close conns
1 parent dae11a4 commit fd3628f

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

coderd/prometheusmetrics/insights/metricscollector_test.go

+7
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,13 @@ func TestCollectInsights(t *testing.T) {
9999
agentClients = append(agentClients, agentAPI)
100100
}
101101

102+
defer func() {
103+
for a := range agentClients {
104+
err := agentClients[a].DRPCConn().Close()
105+
require.NoError(t, err)
106+
}
107+
}()
108+
102109
// Fake app stats
103110
_, err = agentClients[0].UpdateStats(context.Background(), &agentproto.UpdateStatsRequest{
104111
Stats: &agentproto.Stats{

coderd/workspaceagents_test.go

+4
Original file line numberDiff line numberDiff line change
@@ -988,6 +988,10 @@ func TestWorkspaceAgent_LifecycleState(t *testing.T) {
988988
ac.SetSessionToken(r.AgentToken)
989989
conn, err := ac.ConnectRPC(ctx)
990990
require.NoError(t, err)
991+
defer func() {
992+
cErr := conn.Close()
993+
require.NoError(t, cErr)
994+
}()
991995
agentAPI := agentproto.NewDRPCAgentClient(conn)
992996

993997
tests := []struct {

0 commit comments

Comments
 (0)