Skip to content

Commit bc5eb1a

Browse files
fix(fcm): Remove retry on 500 errors in the default config (#453)
* Remove retry on 500 errors in the default config Remove retry on 500 errors in the default config * Update http_client_test.go * Update ref_test.go * Update ref_test.go Co-authored-by: Google Open Source Bot <26440463+google-oss-bot@users.noreply.github.com>
1 parent 862fabe commit bc5eb1a

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

db/ref_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ func TestWelformedHttpError(t *testing.T) {
303303
})
304304
}
305305

306-
wantReqs := len(testOps) * (1 + defaultMaxRetries)
306+
wantReqs := len(testOps)
307307
if len(mock.Reqs) != wantReqs {
308308
t.Errorf("Requests = %d; want = %d", len(mock.Reqs), wantReqs)
309309
}
@@ -333,7 +333,7 @@ func TestUnexpectedHttpError(t *testing.T) {
333333
})
334334
}
335335

336-
wantReqs := len(testOps) * (1 + defaultMaxRetries)
336+
wantReqs := len(testOps)
337337
if len(mock.Reqs) != wantReqs {
338338
t.Errorf("Requests = %d; want = %d", len(mock.Reqs), wantReqs)
339339
}

internal/http_client.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ func WithDefaultRetryConfig(hc *http.Client) *HTTPClient {
7979
RetryConfig: &RetryConfig{
8080
MaxRetries: 4,
8181
CheckForRetry: retryNetworkAndHTTPErrors(
82-
http.StatusInternalServerError,
8382
http.StatusServiceUnavailable,
8483
),
8584
ExpBackoffFactor: 0.5,

internal/http_client_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -733,7 +733,7 @@ func TestNewHTTPClientRetryOnHTTPErrors(t *testing.T) {
733733

734734
client.RetryConfig.ExpBackoffFactor = 0
735735
client.SuccessFn = acceptAll
736-
for _, status = range []int{http.StatusInternalServerError, http.StatusServiceUnavailable} {
736+
for _, status = range []int{http.StatusServiceUnavailable} {
737737
requests = 0
738738
req := &Request{Method: http.MethodGet, URL: server.URL}
739739
resp, err := client.Do(context.Background(), req)

0 commit comments

Comments
 (0)