-
Notifications
You must be signed in to change notification settings - Fork 60
fix: make PVC Bound timeout configurable in wait_for_dv_success #2479
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
fix: make PVC Bound timeout configurable in wait_for_dv_success #2479
Conversation
WalkthroughAdded a new optional parameter Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes ✨ Finishing Touches
🧪 Generate 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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
Status, Documentation and Community
|
Report bugs in Issues Welcome! 🎉This pull request will be automatically processed with the following features: 🔄 Automatic Actions
📋 Available CommandsPR Status Management
Review & Approval
Testing & Validation
Container Operations
Cherry-pick Operations
Label Management
✅ Merge RequirementsThis PR will be automatically approved when the following conditions are met:
📊 Review ProcessApprovers and ReviewersApprovers:
Reviewers:
Available Labels
💡 Tips
For more information, please refer to the project documentation or contact the maintainers. |
/verified |
/retest conventional-title |
/verified |
/wip |
98407d1
to
9b6c14e
Compare
9b6c14e
to
3f59fa9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🔭 Outside diff range comments (1)
ocp_resources/datavolume.py (1)
269-278
: Preserve backward compatibility by making pvc_wait_for_bound_timeout keyword-onlyOur search found no internal calls to
wait_for_dv_success
with three or more positional arguments. However, to avoid breaking any external callers that rely on positional arguments, move the new parameter after*stop_status_func_args
:def wait_for_dv_success( self, timeout=TIMEOUT_10MINUTES, failure_timeout=TIMEOUT_2MINUTES, - pvc_wait_for_bound_timeout=TIMEOUT_1MINUTE, dv_garbage_collection_enabled=False, stop_status_func=None, - *stop_status_func_args, + *stop_status_func_args, + pvc_wait_for_bound_timeout=TIMEOUT_1MINUTE, **stop_status_func_kwargs, ):
🧹 Nitpick comments (2)
ocp_resources/datavolume.py (2)
282-287
: Clarify units/defaults in docstring for the new argument and existing ones.Explicitly state units and that pvc_wait_for_bound_timeout is keyword-only. This reduces misuse and improves readability.
Apply this docstring tweak:
- timeout (int): Time to wait for the DataVolume to succeed. - failure_timeout (int): Time to wait for the DataVolume to have not Pending/None status - pvc_wait_for_bound_timeout (int): Time to wait for the PVC to reach 'Bound' status. - dv_garbage_collection_enabled (bool, default: False): if True, expect that DV will disappear after success + timeout (int, seconds): Time to wait for the DataVolume to succeed. + failure_timeout (int, seconds): Time to wait for the DataVolume to have not Pending/None status. + dv_garbage_collection_enabled (bool, default: False): If True, expect that DV will disappear after success. + pvc_wait_for_bound_timeout (int, seconds, keyword-only): Time to wait for the PVC to reach 'Bound' status (default: 60s).
298-301
: Docstring return type is incorrect; function returns None or raises.wait_for_status returns None and raises TimeoutExpiredError on failure. The docstring claiming a bool return is misleading.
Apply this docstring correction:
- Returns: - bool: True if DataVolume succeeded. + Returns: + None: Waits until success. Raises TimeoutExpiredError on timeout/failure.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
ocp_resources/datavolume.py
(3 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
ocp_resources/datavolume.py (2)
ocp_resources/resource.py (4)
wait_for_status
(832-880)status
(937-947)Status
(288-305)Status
(317-320)ocp_resources/persistent_volume_claim.py (2)
PersistentVolumeClaim
(7-115)Status
(14-15)
🔇 Additional comments (1)
ocp_resources/datavolume.py (1)
329-331
: LGTM: PVC Bound wait now respects the configurable timeout.Using pvc_wait_for_bound_timeout here properly decouples DV success timeout from PVC Bound timeout.
/verified |
/lgtm |
/lgtm |
/approve |
Short description:
some PVC take more than 1 Min to bound, increase time for 2Min
addin the ability to Increase the PVC Bound wait timeout from 1 minute to X minutes to handle delayed binding in specific scenarios.
More details:
Some PVCs take slightly longer than 1 minute to reach the Bound phase, especially when the scratch PVC is restarted. In such cases, the main PVC may temporarily report the following condition:
cdi.kubevirt.io/storage.condition.running.message: scratch space required and none found
cdi.kubevirt.io/storage.condition.running.reason: Scratch space required
This delay can cause test flakes, particularly in T2 test cases. To address this, the wait_for_dv_success method now accepts a configurable pvc_wait_for_bound_timeout argument (defaulting to 1 minute), allowing tests to extend this timeout as needed.
What this PR does / why we need it:
Introduces a configurable PVC Bound wait timeout (pvc_wait_for_bound_timeout) to avoid flakiness.
Fixes some T2 test failures caused by PVCs taking slightly longer to bind.
Which issue(s) this PR fixes:
https://issues.redhat.com/browse/CNV-66509
Special notes for reviewer:
https://redhat-internal.slack.com/archives/C01B610HL81/p1755006925664399
Bug:
Summary by CodeRabbit