Skip to content

Commit

Permalink
Handle the unhandled error not to silently fail (#1752)
Browse files Browse the repository at this point in the history
  • Loading branch information
rakyll authored Dec 2, 2020
1 parent fdc35d5 commit e8c333e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions exporter/awsprometheusremotewriteexporter/auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ func TestRequestSignature(t *testing.T) {
w.WriteHeader(200)
}))
defer server.Close()
serverURL, _ := url.Parse(server.URL)

serverURL, err := url.Parse(server.URL)
assert.NoError(t, err)

setting := confighttp.HTTPClientSettings{
Endpoint: serverURL.String(),
TLSSetting: configtls.TLSClientSetting{},
Expand All @@ -56,8 +59,8 @@ func TestRequestSignature(t *testing.T) {
client, _ := setting.ToClient()
req, err := http.NewRequest("POST", setting.Endpoint, strings.NewReader("a=1&b=2"))
assert.NoError(t, err)
client.Do(req)

_, err = client.Do(req)
assert.NoError(t, err)
}

type ErrorRoundTripper struct{}
Expand Down Expand Up @@ -118,7 +121,6 @@ func TestRoundTrip(t *testing.T) {
}

func TestNewSigningRoundTripper(t *testing.T) {

defaultRoundTripper := (http.RoundTripper)(http.DefaultTransport.(*http.Transport).Clone())

// Some form of AWS credentials must be set up for tests to succeed
Expand Down

0 comments on commit e8c333e

Please sign in to comment.