From 6386b9eac03dc205ac9dd6d87164f71f388b547a Mon Sep 17 00:00:00 2001 From: Cacie Prins Date: Mon, 2 Dec 2024 13:12:33 -0500 Subject: [PATCH] do not retry instance creation, report that cannot proceed with failed cloud in serial --- .../CLOUD_CANNOT_PROCEED_IN_SERIAL.html | 4 ++- packages/errors/src/errors.ts | 2 ++ packages/server/lib/cloud/api/index.ts | 28 +++++++++---------- 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/packages/errors/__snapshot-html__/CLOUD_CANNOT_PROCEED_IN_SERIAL.html b/packages/errors/__snapshot-html__/CLOUD_CANNOT_PROCEED_IN_SERIAL.html index a2843bf81720..bf2d0c01d935 100644 --- a/packages/errors/__snapshot-html__/CLOUD_CANNOT_PROCEED_IN_SERIAL.html +++ b/packages/errors/__snapshot-html__/CLOUD_CANNOT_PROCEED_IN_SERIAL.html @@ -38,6 +38,8 @@ StatusCodeError: 500 - "Internal Server Error" +Because you passed the --record flag, this run cannot proceed because it requires a valid response from our servers. + The --group flag you passed was: foo -The --ciBuildId flag you passed was: invalid +The --ciBuildId flag you passed was: invalid \ No newline at end of file diff --git a/packages/errors/src/errors.ts b/packages/errors/src/errors.ts index 589353504a4e..e05d46f90179 100644 --- a/packages/errors/src/errors.ts +++ b/packages/errors/src/errors.ts @@ -188,6 +188,8 @@ export const AllCypressErrors = { ${fmt.highlightSecondary(arg1.response)} + Because you passed the ${fmt.flag(`--record`)} flag, this run cannot proceed because it requires a valid response from our servers. + ${fmt.listFlags(arg1.flags, { group: '--group', ciBuildId: '--ciBuildId', diff --git a/packages/server/lib/cloud/api/index.ts b/packages/server/lib/cloud/api/index.ts index 9f999bbd9f46..96cc7e45bfef 100644 --- a/packages/server/lib/cloud/api/index.ts +++ b/packages/server/lib/cloud/api/index.ts @@ -458,22 +458,20 @@ export default { 'platform', ]) - return retryWithBackoff((attemptIndex) => { - return rp.post({ - body, - url: recordRoutes.instances(runId), - json: true, - encrypt: preflightResult.encrypt, - timeout: timeout ?? SIXTY_SECONDS, - headers: { - 'x-route-version': '5', - 'x-cypress-run-id': runId, - 'x-cypress-request-attempt': attemptIndex, - }, - }) - .catch(RequestErrors.StatusCodeError, formatResponseBody) - .catch(tagError) + return rp.post({ + body, + url: recordRoutes.instances(runId), + json: true, + encrypt: preflightResult.encrypt, + timeout: timeout ?? SIXTY_SECONDS, + headers: { + 'x-route-version': '5', + 'x-cypress-run-id': runId, + 'x-cypress-request-attempt': 0, + }, }) + .catch(RequestErrors.StatusCodeError, formatResponseBody) + .catch(tagError) }, postInstanceTests (options) {