Commit Graph

10 Commits

Author SHA1 Message Date
cncal
2670042dde fix wrong statement in unittest of BoundedFrequencyRunner 2022-11-15 17:36:26 +08:00
songlh
8cceaa051d apply gofmt 2021-12-17 17:35:09 -05:00
songlh
d4f3dde804 time -> timer 2021-12-17 16:03:46 -05:00
songlh
a108393b8c add spaces to comments 2021-12-17 15:41:34 -05:00
songlh
8886e58ae9 add comments to the fix 2021-12-17 15:22:27 -05:00
songlh
ed1823a6c2 fixing three goroutine leaks in bounded_frequency_runner_test.go 2021-12-16 23:31:11 -05:00
Dan Winship
4c5f4cb353 BoundedFrequencyRunner: add RetryAfter 2019-10-29 07:36:00 -04:00
Dan Winship
478fadccff BoundedFrequencyRunner: fix tests
The tests were using a fake timer that only ticked when the test cases
told it to, so it would only be correctly testing the
BoundedFrequencyRunner functionality if the test cases made it tick
whenever the BFR timer was supposed to expire, and didn't make it tick
at any other time. But they didn't do that. Fix it to tick
automatically at the correct times, and update the test cases
accordingly (including adding a new helper method for asserting that
the runner did nothing in cases when it's expected to have done
nothing).

Also fix two unrelated minor bugs in fakeTimer.
2019-10-22 08:17:30 -04:00
Jordan Liggitt
4b9f00988b
Switch from juju/ratelimit to golang.org/x/time/rate 2018-01-19 11:48:52 -05:00
Tim Hockin
bbb80c252b Add bounded frequency runner
This lib manages runs of a function to have min and max frequencies.
2017-05-24 20:33:15 -07:00