From 84110df3c262da987ec5d0c44f6688f5e627f40c Mon Sep 17 00:00:00 2001 From: Dave Henderson Date: Tue, 28 May 2024 18:51:31 -0400 Subject: [PATCH] chore(lint): fix lint warning Signed-off-by: Dave Henderson --- internal/tests/integration/datasources_vault_ec2_test.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/tests/integration/datasources_vault_ec2_test.go b/internal/tests/integration/datasources_vault_ec2_test.go index 9e4a51925..c00a8d43e 100644 --- a/internal/tests/integration/datasources_vault_ec2_test.go +++ b/internal/tests/integration/datasources_vault_ec2_test.go @@ -10,6 +10,7 @@ import ( "net/http/httptest" "testing" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "gotest.tools/v3/fs" ) @@ -28,7 +29,10 @@ func setupDatasourcesVaultEc2Test(t *testing.T) (*fs.Dir, *vaultClient, *httptes if r.Body != nil { var err error b, err = io.ReadAll(r.Body) - require.NoError(t, err) + if !assert.NoError(t, err) { + w.WriteHeader(http.StatusInternalServerError) + return + } defer r.Body.Close() } t.Logf("IMDS Token request: %s %s: %s", r.Method, r.URL, b)