Repository navigation
Fix flaky test_rate_more_per_minute - #8135
Conversation
There was a problem hiding this comment.
Pull request overview
This PR addresses flaky behavior in the RateLimiter unit test by avoiding an overly strict floating-point equality assertion that can be affected by small elapsed-time differences between try_consume calls.
Changes:
- Replaced an exact float comparison in
test_rate_more_per_minutewith an inclusive range assertion to tolerate minor token refills during execution.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
📝 WalkthroughWalkthroughThis pull request modifies a test assertion in Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 6✅ Passed checks (6 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 Tip Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
why not just change eps? |
|
I saw eps was already increased in #6476 and it still flaked. So this avoids having to keep bumping it. |
I think this is better because eps can drift both up and down, but tokens can only drift upward here |
Co-authored-by: lhenon999 <[email protected]>
Co-authored-by: lhenon999 <[email protected]>
Fixes #7485
Replace exact float assertion with range check [589.0, 590.0] to tolerate
time between consume calls. Test-only.
All Submissions:
devbranch. Did you create your branch fromdev?New Feature Submissions:
cargo +nightly fmt --allcommand prior to submission?cargo clippy --workspace --all-featurescommand?