Skip to content
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 #528 (retry count 1 less than retry limit) #547

Conversation

MunyuShizumi
Copy link
Contributor

@MunyuShizumi MunyuShizumi commented Dec 6, 2023

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.

Copy link
Collaborator

@sholladay sholladay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, aside from the CI failure / config issue.

@sindresorhus sindresorhus merged commit 917ab12 into sindresorhus:main Jan 7, 2024
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

retry is wrongly counting
3 participants