@@ -58,7 +58,9 @@ func TestRetryTransport_StatusBehavior(t *testing.T) {
5858 {"success_first_attempt" , http .StatusOK , 0 , http .StatusOK , 1 },
5959 {"retries_on_5xx" , http .StatusBadGateway , 3 , http .StatusOK , 3 },
6060 {"retries_on_429" , http .StatusTooManyRequests , 2 , http .StatusOK , 2 },
61- {"no_retry_on_4xx" , http .StatusNotFound , 999 , http .StatusNotFound , 1 },
61+ {"retries_on_400" , http .StatusBadRequest , 2 , http .StatusOK , 2 },
62+ {"retries_on_404" , http .StatusNotFound , 2 , http .StatusOK , 2 },
63+ {"no_retry_on_other_4xx" , http .StatusForbidden , 999 , http .StatusForbidden , 1 },
6264 {"exhausts_max_attempts" , http .StatusServiceUnavailable , 999 , http .StatusServiceUnavailable , 3 },
6365 }
6466 for _ , tt := range tests {
@@ -155,10 +157,10 @@ func TestShouldRetry(t *testing.T) {
155157 }{
156158 {"200 OK" , http .StatusOK , false },
157159 {"201 Created" , http .StatusCreated , false },
158- {"400 Bad Request" , http .StatusBadRequest , false },
160+ {"400 Bad Request" , http .StatusBadRequest , true },
159161 {"401 Unauthorized" , http .StatusUnauthorized , false },
160162 {"403 Forbidden" , http .StatusForbidden , false },
161- {"404 Not Found" , http .StatusNotFound , false },
163+ {"404 Not Found" , http .StatusNotFound , true },
162164 {"408 Request Timeout" , http .StatusRequestTimeout , true },
163165 {"429 Too Many Requests" , http .StatusTooManyRequests , true },
164166 {"500 Internal Server Error" , http .StatusInternalServerError , true },
0 commit comments