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: make LinearRetry behave linearly for all inputs #702

Merged
merged 8 commits into from
Oct 23, 2022

Conversation

ToxicMushroom
Copy link
Contributor

fixes #596

gateway/src/main/kotlin/retry/LinearRetry.kt Outdated Show resolved Hide resolved
gateway/src/main/kotlin/retry/LinearRetry.kt Outdated Show resolved Hide resolved
gateway/src/test/kotlin/helper/LinearRetryTest.kt Outdated Show resolved Hide resolved
Copy link
Member

@lukellmann lukellmann left a comment

Choose a reason for hiding this comment

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

Just two last things - then we should be good to go.

gateway/src/main/kotlin/retry/LinearRetry.kt Outdated Show resolved Hide resolved

val end = currentTime
val elapsed = (end-start).milliseconds
assert(elapsed >= 55.seconds)
Copy link
Member

Choose a reason for hiding this comment

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

These assertions should use == instead of >= or <= - virtual time is always exact and predictable.

@lukellmann lukellmann self-requested a review October 23, 2022 23:46
Copy link
Member

@lukellmann lukellmann left a comment

Choose a reason for hiding this comment

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

Thanks for your efforts!

@lukellmann lukellmann merged commit b4b24ea into kordlib:0.8.x Oct 23, 2022
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.

LinearRetry is not linear between start and finish
2 participants