Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/cache/__tests__/requestUtils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ test('retry fails after exhausting retries', async () => {
})

test('retry fails after non-retryable status code', async () => {
await testRetryExpectingError([TestResponse(500), TestResponse(200, 'Ok')])
await testRetryExpectingError([TestResponse(501), TestResponse(200, 'Ok')])
})

test('retry works after error', async () => {
Expand Down
6 changes: 3 additions & 3 deletions packages/cache/__tests__/saveCache.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ test('save with reserve cache failure should fail', async () => {
.spyOn(cacheHttpClient, 'reserveCache')
.mockImplementation(async () => {
const response: TypedResponse<ReserveCacheResponse> = {
statusCode: 500,
statusCode: 501,
result: null,
headers: {}
}
Expand Down Expand Up @@ -228,7 +228,7 @@ test('save with server error should fail', async () => {
.spyOn(cacheHttpClient, 'reserveCache')
.mockImplementation(async () => {
const response: TypedResponse<ReserveCacheResponse> = {
statusCode: 500,
statusCode: 501,
result: {cacheId},
headers: {}
}
Expand Down Expand Up @@ -282,7 +282,7 @@ test('save with valid inputs uploads a cache', async () => {
.spyOn(cacheHttpClient, 'reserveCache')
.mockImplementation(async () => {
const response: TypedResponse<ReserveCacheResponse> = {
statusCode: 500,
statusCode: 501,
result: {cacheId},
headers: {}
}
Expand Down
1 change: 1 addition & 0 deletions packages/cache/src/internal/requestUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export function isRetryableStatusCode(statusCode?: number): boolean {
return false
}
const retryableStatusCodes = [
HttpCodes.InternalServerError,
HttpCodes.BadGateway,
HttpCodes.ServiceUnavailable,
HttpCodes.GatewayTimeout
Expand Down