-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: disable automatic request retries #19161
Changes from 11 commits
e8c01d8
ae7bda8
97bad5e
9c019a7
b15d8b7
cf532de
be07807
e5fa008
008613f
6292de3
d627123
d618df3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -118,6 +118,11 @@ const maybeRetryOnNetworkFailure = function (err, options = {}) { | |||||||||||
// https://github.com/cypress-io/cypress/pull/6705 | ||||||||||||
debug('detected TLS version error, setting min version to TLSv1') | ||||||||||||
opts.minVersion = 'TLSv1' | ||||||||||||
|
||||||||||||
if (retryIntervals.length === 0) { | ||||||||||||
// normally, this request would not be retried, but we need to retry in order to support TLSv1 | ||||||||||||
return onNext(0, 1) | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what does There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. cypress/packages/server/lib/request.js Lines 284 to 288 in 9e4c13a
So this runs a single
So many ways. 😄 I started refactoring this file and it became a much bigger task, so I decided to keep this PR to the bare minimum changes. For now I pushed a commit to clean up |
||||||||||||
} | ||||||||||||
} | ||||||||||||
|
||||||||||||
if (!isTlsVersionError && !isErrEmptyResponseError(err.originalErr || err) && !isRetriableError(err, retryOnNetworkFailure)) { | ||||||||||||
|
@@ -414,7 +419,7 @@ const setDefaults = (opts) => { | |||||||||||
.chain(opts) | ||||||||||||
.defaults({ | ||||||||||||
requestId: _.uniqueId('request'), | ||||||||||||
retryIntervals: [0, 1000, 2000, 2000], | ||||||||||||
retryIntervals: [], | ||||||||||||
retryOnNetworkFailure: true, | ||||||||||||
retryOnStatusCodeFailure: false, | ||||||||||||
}) | ||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we adding retry intervals here and above?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previously this would inherit from the defaults in
server/lib/request
, but now it has to set its own.Automatic retries are still used for
cy.visit
'sresolve:url
andcy.request
, since those are not retriable by the browser. Fully removing automatic retries is a breaking change b/c we expose retryOnNetworkFailure and retryOnStatusCodeFailure as opts on cy.request, cy.visit