Skip to content

Improve llm global rate limit test#2567

Open
ashera96 wants to merge 1 commit into
wso2:mainfrom
ashera96:ratelimit-test-fix
Open

Improve llm global rate limit test#2567
ashera96 wants to merge 1 commit into
wso2:mainfrom
ashera96:ratelimit-test-fix

Conversation

@ashera96

@ashera96 ashera96 commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Purpose

Changes introduced via this PR

  • Reverts the test which was commented out via [1] due to an intermittent test failure.
  • Intermittent failure was noticed due to an issue in the advanced-ratelimit policy which is fixed via [2].
  1. Fix intermittent ratelimit test failure #2306
  2. fix(ratelimit): key stale-limiter cleanup by attachment level to stop cross-route bucket eviction gateway-controllers#216

@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 8c8f29c1-c93a-45f1-91e4-7acf755edecb

📥 Commits

Reviewing files that changed from the base of the PR and between 737bef5 and ebbdcc1.

📒 Files selected for processing (1)
  • gateway/it/features/llm-provider-global-ratelimit.feature

📝 Walkthrough

Walkthrough

Adds two Gherkin scenarios (9 and 10) to an existing feature file, testing that a global apiname-keyed advanced-ratelimit bucket is shared across API operations for both provider and proxy contexts, even when an operation-level rate-limit policy rejects requests on one endpoint first.

Changes

Mixed global/operation rate-limit scenarios

Layer / File(s) Summary
Provider mixed rate-limit scenario
gateway/it/features/llm-provider-global-ratelimit.feature
Scenario 9 combines a global apiname-keyed advanced-ratelimit policy with an operation-level basic-ratelimit on /chat/completions for a provider, asserting /embeddings also returns 429 once the shared global bucket is exhausted.
Proxy mixed rate-limit scenario
gateway/it/features/llm-provider-global-ratelimit.feature
Scenario 10 applies the same mixed policy configuration to an LLM proxy context, asserting identical 429 exhaustion behavior on /embeddings after /chat/completions is rejected by the operation cap.

Estimated code review effort: 1 (Trivial) | ~5 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description only covers Purpose and a brief change note; most required sections from the template are missing. Add the missing Goals, Approach, User stories, Documentation, Automation tests, Security checks, Samples, Related PRs, and Test environment sections.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and matches the main change: improving the LLM global rate-limit test.
Linked Issues check ✅ Passed The PR re-enables the flaky mixed global/operation rate-limit scenarios for issue #2317 using apiname-keyed advanced-ratelimit plus operation policy.
Out of Scope Changes check ✅ Passed The changes stay within the linked issue scope by adding mixed global/operation rate-limit test scenarios and no unrelated code.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

[Bug]: advanced-ratelimit: in-memory bucket for an apiname key is non-deterministically split per-route instead of shared across an API's operations

1 participant