Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
test(system-tests): update 500 retry behavior
Capture-protocol upload now retries 3 times on HTTP 500 (matching the
503 path) since 500 is now part of the retryable status list. The
test description, assertion, and snapshot are updated accordingly.
  • Loading branch information
mschile committed Apr 30, 2026
commit daacbcee45926a42e5cbc576edc119aeea050b62
12 changes: 6 additions & 6 deletions system-tests/__snapshots__/record_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3420,7 +3420,7 @@ exports['e2e record capture-protocol enabled passing retrieves the capture proto

`

exports['capture-protocol api errors upload 500 - does not retry continues 1'] = `
exports['capture-protocol api errors upload 500 - tries 3 times and fails continues 1'] = `

====================================================================================================

Expand Down Expand Up @@ -3485,13 +3485,13 @@ exports['capture-protocol api errors upload 500 - does not retry continues 1'] =
- Screenshot - Done Uploading 1 kB in Xm, Ys ZZ.ZZms 1/2 /XXX/XXX/XXX/cypress/screenshots/record_pass.cy.js/yay it passes.png
- Test Replay - Failed Uploading after Xm, Ys ZZ.ZZms 2/2 - http://localhost:1234/capture-protocol/upload/?x-amz-credential=XXXXXXXX&x-amz-signature=XXXXXXXXXXXXX responded with 500 Internal Server Error

Warning: We encountered an HTTP error while uploading the Test Replay recording for this spec.

These results will not display Test Replay recordings.
Warning: We encountered multiple errors while uploading the Test Replay recording for this spec.

This error will not affect or change the exit code.
We attempted to upload the Test Replay recording 3 times.

http://localhost:1234/capture-protocol/upload/?x-amz-credential=XXXXXXXX&x-amz-signature=XXXXXXXXXXXXX responded with HTTP 500: Internal Server Error
http://localhost:1234/capture-protocol/upload/?x-amz-credential=XXXXXXXX&x-amz-signature=XXXXXXXXXXXXX responded with 500 Internal Server Error
http://localhost:1234/capture-protocol/upload/?x-amz-credential=XXXXXXXX&x-amz-signature=XXXXXXXXXXXXX responded with 500 Internal Server Error
http://localhost:1234/capture-protocol/upload/?x-amz-credential=XXXXXXXX&x-amz-signature=XXXXXXXXXXXXX responded with 500 Internal Server Error

====================================================================================================

Expand Down
12 changes: 8 additions & 4 deletions system-tests/test/record_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3009,7 +3009,7 @@ describe('capture-protocol api errors', () => {
}))
}

describe('upload 500 - does not retry', () => {
describe('upload 500 - tries 3 times and fails', () => {
stubbedServerWithErrorOn('putCaptureProtocolUpload')
it('continues', function () {
process.env.API_RETRY_INTERVALS = '1000'
Expand All @@ -3028,9 +3028,13 @@ describe('capture-protocol api errors', () => {
const artifactReport = getRequests().find(({ url }) => url === `PUT /instances/${instanceId}/artifacts`)?.body

expect(artifactReport?.protocol).to.exist
expect(artifactReport?.protocol?.error).to.equal(
'Failed to upload Test Replay: http://localhost:1234/capture-protocol/upload/?x-amz-credential=XXXXXXXX&x-amz-signature=XXXXXXXXXXXXX responded with 500 Internal Server Error',
)

const expectedUrl = `http://localhost:1234/capture-protocol/upload/?x-amz-credential=XXXXXXXX&x-amz-signature=XXXXXXXXXXXXX`
const expectedErrorMessage = `${expectedUrl} responded with 500 Internal Server Error`

expect(artifactReport?.protocol?.error).to.equal(`Failed to upload Test Replay after 3 attempts. Errors: ${[expectedErrorMessage, expectedErrorMessage, expectedErrorMessage].join(', ')}`)
expect(artifactReport?.protocol?.errorStack).to.exist
expect(artifactReport?.protocol?.errorStack).to.not.be.empty
})
})
})
Expand Down
Loading