From a1aa5918f00f73b8981bc33a30f4b541ce6207df Mon Sep 17 00:00:00 2001 From: "Chris S. Kim" Date: Thu, 14 Sep 2023 11:10:04 -0400 Subject: [PATCH] Clean up resources in test --- agent/agent_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/agent/agent_test.go b/agent/agent_test.go index f3932c792d40..455a8bbb3e66 100644 --- a/agent/agent_test.go +++ b/agent/agent_test.go @@ -354,10 +354,10 @@ func TestAgent_HTTPMaxHeaderBytes(t *testing.T) { require.NoError(t, err) a, err := New(bd) + require.NoError(t, err) mockDelegate := delegateMock{} mockDelegate.On("LicenseCheck").Return() a.delegate = &mockDelegate - require.NoError(t, err) a.startLicenseManager(testutil.TestContext(t)) @@ -392,6 +392,8 @@ func TestAgent_HTTPMaxHeaderBytes(t *testing.T) { resp, err := client.Do(req.WithContext(ctx)) require.NoError(t, err) require.Equal(t, tt.expectedHTTPResponse, resp.StatusCode, "expected a '%d' http response, got '%d'", tt.expectedHTTPResponse, resp.StatusCode) + resp.Body.Close() + s.Shutdown(ctx) } }) }