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

Update example to include a withoutSlack option #96

Merged
merged 1 commit into from
Jul 7, 2022
Merged

Conversation

rabbbit
Copy link
Contributor

@rabbbit rabbbit commented Jul 6, 2022

In #90 @twelsh-aw found a bug in a new implementation. This turned out
to be caused by us mocking time.

Since time mocking will always have some risks this diff proposes
to expand the examples we're using - since they use "real" time
they should be good enough to cover most basic cases like #90.

In particular:

  • we add a "withoutSlack" test so that the exact case reported in atomicInt64Limiter WithoutSlack doesn't block #90
    doesn't happen. No slack option seems common enough to add it.
  • updates "withSlack" example to actually show how slack operates.
    Due to non-even execution times I'm forced to round the time a bit.

Possible issues:

  • test stability: I re-run the test a 1000 times without issues - the
    timing seems to be stable.
  • test duration: in total we're extending the examples by 5ms, which
    shouldn't be human noticeable.

In #90 @twelsh-aw found a bug in a new implementation. This turned out
to be caused by us mocking time.

Since time mocking will always have some risks this diff proposes
to expand the `examples` we're using - since they use "real" time
they should be good enough to cover most basic cases like #90.

In particular:
- we add a "withoutSlack" test so that the exact case reported in #90
  doesn't happen. No slack option seems common enough to add it.
- updates "withSlack" example to actually show how slack operates.
  Due to non-even execution times I'm forced to round the time a bit.

Possible issues:
- test stability: I re-run the test a 1000 times without issues - the
  timing seems to be stable.
- test duration: in total we're extending the examples by 5ms, which
  shouldn't be human noticeable.
@codecov
Copy link

codecov bot commented Jul 6, 2022

Codecov Report

Merging #96 (0917cd8) into main (783ade2) will not change coverage.
The diff coverage is n/a.

@@            Coverage Diff            @@
##              main       #96   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            4         4           
  Lines           97        97           
=========================================
  Hits            97        97           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 783ade2...0917cd8. Read the comment docs.

@rabbbit
Copy link
Contributor Author

rabbbit commented Jul 6, 2022

Hey @storozhukBM WDYT?

@storozhukBM
Copy link
Contributor

@rabbbit looks good

@rabbbit rabbbit merged commit 29ac3a2 into main Jul 7, 2022
@rabbbit rabbbit deleted the pawel/example branch July 7, 2022 03:39
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.

None yet

2 participants