Clean up resources in test (#18799)

This commit is contained in:
Chris S. Kim 2023-09-14 11:33:19 -04:00 committed by GitHub
parent 658c27a684
commit 6748fac43d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -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)
}
})
}