fix(utils): close resp in test to satisfy bodyclose linter
This commit is contained in:
parent
e8c6d82fdb
commit
2ab6704e59
1 changed files with 3 additions and 0 deletions
|
|
@ -107,6 +107,9 @@ func TestDoRequestWithRetry_ContextCancel(t *testing.T) {
|
|||
require.NoError(t, err)
|
||||
|
||||
resp, err := DoRequestWithRetry(client, req)
|
||||
if resp != nil {
|
||||
resp.Body.Close()
|
||||
}
|
||||
require.Error(t, err, "expected error from context cancellation")
|
||||
assert.Nil(t, resp, "expected nil response when context is canceled")
|
||||
assert.True(t, bodyClosed, "expected resp.Body to be closed on context cancellation")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue