chore: Close idle connections on test cleanup (#4993)

It's possible that this was the source of a leak on Windows...
This commit is contained in:
Kyle Carberry
2022-11-13 14:06:03 -06:00
committed by GitHub
parent 30e9ecbc96
commit 49c7648af5
4 changed files with 14 additions and 1 deletions
+1
View File
@@ -568,6 +568,7 @@ func Server(vip *viper.Viper, newAPI func(context.Context, *coderd.Options) (*co
InsecureSkipVerify: true,
},
}
defer client.HTTPClient.CloseIdleConnections()
}
// Since errCh only has one buffered slot, all routines
+1
View File
@@ -425,6 +425,7 @@ func TestServer(t *testing.T) {
},
},
}
defer client.HTTPClient.CloseIdleConnections()
// Use the first certificate and hostname.
client.URL.Host = "alpaca.com:443"