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

Clear lastVersion in a case of returning an empty TokenBucketState #30

Merged

Conversation

oskarwojciski
Copy link
Contributor

Solving #29

Copy link

codecov bot commented Nov 28, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (4dbb27f) 82.93% compared to head (6b2a9dc) 83.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #30      +/-   ##
==========================================
+ Coverage   82.93%   83.00%   +0.07%     
==========================================
  Files          10       10              
  Lines        1178     1183       +5     
==========================================
+ Hits          977      982       +5     
  Misses        137      137              
  Partials       64       64              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Owner

@mennanov mennanov left a comment

Choose a reason for hiding this comment

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

Looks good!

Comment on lines +368 to +371
if t.raceCheck {
// reset in a case of returning an empty TokenBucketState
t.lastVersion = 0
}
Copy link
Owner

Choose a reason for hiding this comment

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

Do you think it makes sense to add the test that covers this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mennanov I can commit the test mentioned here: #29. It is not so "generic" compared to other tests but the issue is not related to other backends.

Copy link
Owner

Choose a reason for hiding this comment

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

Hm.. let's keep the tests generic.
I will merge this PR as is.

Comment on lines +368 to +371
if t.raceCheck {
// reset in a case of returning an empty TokenBucketState
t.lastVersion = 0
}
Copy link
Owner

Choose a reason for hiding this comment

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

Hm.. let's keep the tests generic.
I will merge this PR as is.

@mennanov mennanov merged commit b9fb5f6 into mennanov:master Dec 4, 2023
7 checks passed
@mennanov
Copy link
Owner

mennanov commented Dec 4, 2023

Thanks for contributing!

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.

2 participants