-
Notifications
You must be signed in to change notification settings - Fork 51
[gating][storage] Fix snapshot readiness wait logic in DataImportCron tests and restore gating marker test_data_import_cron_garbage_collection #2938
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
base: main
Are you sure you want to change the base?
Conversation
WalkthroughAdded a pytest Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
Suggested labels
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ 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 |
c2a84df to
3a2a6f1
Compare
|
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. |
3a2a6f1 to
5d594e3
Compare
|
/verified verified on psi and on bare metal I have execute the test 5 times each since now we returning the gating marker, and it passed 100% all the runs |
Test execution plan request detailsCRITICAL: You MUST respond with a review comment on the Files Changed tab, NOT as a regular PR comment. As an expert software testing engineer, analyze all modified files in this PR and create a targeted test execution plan. Analysis Requirements:
Your deliverable: Test Execution Plan
Guidelines:
|
|
Tip For best results, initiate chat on the files or code changes. @openshift-virtualization-qe-bot-3, I understand you require a review comment on the Files Changed tab rather than a PR comment. However, based on my current interface capabilities, I can only post responses as PR comments. I cannot directly create review comments on specific lines in the Files Changed tab. Here is the test execution plan that should be posted on the Files Changed tab: Test Execution PlanModified files analysis:
Tests to execute: Rationale:
Note to maintainers: Please copy this test execution plan to a review comment on the first line of 🧠 Learnings used |
|
/verified executed 25 repeats on psi, pass rate 100% |
|
/build-and-push-container |
|
New container for quay.io/openshift-cnv/openshift-virtualization-tests:pr-2938 published |
|
/lgtm |
|
/approve |
|
/approve |
Fix DataImportCron test failures by properly waiting for VolumeSnapshot readiness using volume_snapshot.wait().
also return gating marker to test_data_import_cron_garbage_collection test
Short description:
DataImportCron tests were failing intermittently because the tests attempted to check VolumeSnapshot.readyToUse before the VolumeSnapshot resource actually existed.
This caused NotFoundError exceptions inside a TimeoutSampler, immediately failing instead of retrying.
gating test failing due to this ::test_data_import_cron_garbage_collection
More details:
volume_snapshot.wait() already handles:
waiting for the VolumeSnapshot to be created
waiting for it to become readyToUse=True
retrying on NotFound errors
What this PR does / why we need it:
minates the race condition between DataVolume completion and VolumeSnapshot creation.
Ensures proper dependency order: DataVolume → VolumeSnapshot.
Simplifies waiting logic by relying on volume_snapshot.wait()
Resolves intermittent test failures caused by NotFoundError.
#####Evidence from cluster outputs:
DataVolume importing (28s-39s) - NO new VolumeSnapshot exists
test-data-import-cron rhel8-947541648d7f ImportInProgress 56.20%→99.38%
test-data-import-cron rhel8-752e28b38ddc true (old snapshot)
data import cron trigger
*here is where the code fails) he is looking for VS test-data-import-cron rhel8-947541648d7f but he didnt find it
because the dv import is not finished
DataVolume completes (42s) - NEW VolumeSnapshot appears immediately
test-data-import-cron rhel8-947541648d7f Succeeded
test-data-import-cron rhel8-947541648d7f true (new snapshot appears)
Which issue(s) this PR fixes:
failed on setup with "ocp_resources.utils.TimeoutExpiredError: Timed Out: 300 Function: utilities.storage..lambda: ready_to_use_status.volume_snapshot.instance.get Last exception: TimeoutExpiredError: Timed Out: 10 Function: ocp_resources.resource._instance Last exception: NotFoundError: 404 Reason: Not Found HTTP response headers: HTTPHeaderDict({'Audit-Id': '0e5e11dc-0117-45b3-88dd-2fba45913c12', 'Cache-Control': 'no-cache, private', 'Content-Type': 'application/json', 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains; preload', 'X-Kubernetes-Pf-Flowschema-Uid': 'fe96e2ca-91ff-4a85-bf1d-bb59abcaa930', 'X-Kubernetes-Pf-Prioritylevel-Uid': '7bcbdcef-aabb-4204-b6f5-1da13f0745ee', 'Date': 'Tue, 21 Oct 2025 20:19:19 GMT', 'Content-Length': '284'}) HTTP response body: b'{"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"volumesnapshots.snapshot.storage.k8s.io "rhel8-947541648d7f" not found","reason":"NotFound","details":{"name":"rhel8-947541648d7f","group":"snapshot.storage.k8s.io","kind":"volumesnapshots"},"code":404}\n' Original traceback: File "/cnv-tests/.venv/lib/python3.12/site-packages/kubernetes/dynamic/client.py", line 55, in inner resp = func(self, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/cnv-tests/.venv/lib/python3.12/site-packages/kubernetes/dynamic/client.py", line 270, in request api_response = self.client.call_api( ^^^^^^^^^^^^^^^^^^^^^ File "/cnv-tests/.venv/lib/python3.12/site-packages/kubernetes/client/api_client.py", line 348, in call_api return self.__call_api(resource_path, method, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/cnv-tests/.venv/lib/python3.12/site-packages/kubernetes/client/api_client.py", line 180, in __call_api response_data = self.request( ^^^^^^^^^^^^^ File "/cnv-tests/.venv/lib/python3.12/site-packages/kubernetes/client/api_client.py", line 373, in request return self.rest_client.GET(url, ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/cnv-tests/.venv/lib/python3.12/site-packages/kubernetes/client/rest.py", line 241, in GET return self.request("GET", url, ^^^^^^^^^^^^^^^^^^^^^^^^ File "/cnv-tests/.venv/lib/python3.12/site-packages/kubernetes/client/rest.py", line 235, in request raise ApiException(http_resp=r)"
Special notes for reviewer:
jira-ticket:
https://issues.redhat.com/browse/CNV-72441
Summary by CodeRabbit
Bug Fixes
Tests
✏️ Tip: You can customize this high-level summary in your review settings.