fix: Add lower limits for mockserver#990
Conversation
|
Warning Review limit reached
More reviews will be available in 30 minutes and 51 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe MockServer backend deployment configuration is updated to provide consistent resource limits and environment defaults. A default ChangesMockServer deployment resource and environment configuration
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
|
/make smoke |
|
Test run completed ( Short Test SummaryFull Output |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
testsuite/backend/mockserver.py (1)
82-82: ⚡ Quick winAdd CPU request for predictable scheduling.
The container specifies a CPU limit but no CPU request. Setting a CPU request improves the quality-of-service class and ensures more predictable scheduling behaviour.
♻️ Suggested improvement
- resources=ContainerResources(limits_cpu="100m", limits_memory="300Mi", requests_memory="200Mi"), + resources=ContainerResources(limits_cpu="100m", limits_memory="300Mi", requests_cpu="100m", requests_memory="200Mi"),🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@testsuite/backend/mockserver.py` at line 82, The ContainerResources instantiation sets limits_cpu but lacks a CPU request, which can cause unpredictable scheduling; update the call to ContainerResources (the constructor used at the resource variable) to include a CPU request (e.g., requests_cpu set to an appropriate value such as "100m" or a value matching your expected baseline) along with existing limits_cpu/limits_memory/requests_memory so the container has both CPU limit and CPU request for predictable scheduling and improved QoS.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@testsuite/backend/mockserver.py`:
- Line 73: In MockserverBackend.commit, reduce the JVM heap so it leaves
headroom by changing env_limit = {"JAVA_TOOL_OPTIONS": "-Xmx300m"} to a smaller
heap (e.g. "-Xmx200m" or similar), and add a CPU request alongside the existing
limits (update ContainerResources(...) to include requests_cpu="50m" or an
appropriate value while keeping limits_cpu="100m"); ensure the env merge (env =
env_limit | self.config.env if self.config else env_limit) still applies default
JAVA_TOOL_OPTIONS but adjust defaults as above so the container
limits_memory="300Mi" has sufficient non-heap headroom.
---
Nitpick comments:
In `@testsuite/backend/mockserver.py`:
- Line 82: The ContainerResources instantiation sets limits_cpu but lacks a CPU
request, which can cause unpredictable scheduling; update the call to
ContainerResources (the constructor used at the resource variable) to include a
CPU request (e.g., requests_cpu set to an appropriate value such as "100m" or a
value matching your expected baseline) along with existing
limits_cpu/limits_memory/requests_memory so the container has both CPU limit and
CPU request for predictable scheduling and improved QoS.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 2482a12d-bd9b-4602-a537-dcd55adb7e54
📒 Files selected for processing (1)
testsuite/backend/mockserver.py
066c0fc to
676dfbc
Compare
Signed-off-by: Alex Zgabur <azgabur@redhat.com>
676dfbc to
d3dabad
Compare
|
/make smoke |
|
Test run completed ( Short Test SummaryFull Output |
|
^ Not sure what is happening here but smoke passes locally |
Description
Lowered limits for mockserver deployment as 2G of memory was too generous for a deployment which will be deployed multiple times on a cluster. I had it cause cluster starvation when it requested about 100g of memory while running release pipeline. Normally mockserver uses about 200mb. I also added java parameter for JVM to prevent OOM.
Verification
touches global code so requires 2 reviewers.