mirror of
https://github.com/kemko/nomad.git
synced 2026-01-04 09:25:46 +03:00
api: use cleanhttp.DefaultPooledTransport for default API client (#12492)
We expect every Nomad API client to use a single connection to any given agent, so take advantage of keep-alive by switching the default transport to `DefaultPooledClient`. Provide a facility to close idle connections for testing purposes. Restores the previously reverted #12409 Co-authored-by: Ben Buzbee <bbuzbee@cloudflare.com>
This commit is contained in:
@@ -1113,6 +1113,8 @@ func TestHTTPServer_Limits_OK(t *testing.T) {
|
||||
conf.Address = a.HTTPAddr()
|
||||
conf.TLSConfig.Insecure = true
|
||||
client, err := api.NewClient(conf)
|
||||
defer client.Close()
|
||||
|
||||
require.NoError(t, err)
|
||||
|
||||
// Assert a blocking query isn't timed out by the
|
||||
|
||||
Reference in New Issue
Block a user