Fix #528 (retry count 1 less than retry limit) #547
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #528 (actual retry count being 1 less than the specified retry limit).
This could be seen as a breaking change for projects using the +1 workaround.
The main issue was
_retryCount
first being incremented, then being checked if it's less than_options.retry.limit
, resulting in an off-by-one which is fixed with a less-or-equal comparison instead.Re-enabled retry count test, and fixed other misconfigured tests which either explicitly failed or had silent bugs related to this. All tests pass with Node v18.18.0 (v18.18.2 breaks a number of tests, and Ava can't use custom loaders with v18.19 or v20+ making testing impossible).
EDIT: CI seems to fail since it doesn't extend
tsconfig.json
properly - I instead pointed it explicitly at./node_modules/@sindresorhus/tsconfig/tsconfig.json
as a quickfix, but messing with the base config seems beyond the scope of this PR.