net, stability, sriov, hotplug: Refactor setup and test steps#4660
Conversation
📝 WalkthroughWalkthroughRemoved a shared context-manager helper that created a VM and hot-plugged an SR-IOV interface; tests were refactored to create the VM and perform SR-IOV hot-plugging via separate pytest fixtures and updated network-attachment formatting. ChangesSR-IOV hot-plug test refactor
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 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 |
|
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
AI Features
💡 Tips
For more information, please refer to the project documentation or contact the maintainers. |
|
/verified |
Test execution plan request detailsCRITICAL: You MUST post an inline review comment on the first changed line of the first file. 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:
Hardware-Related Checks (SR-IOV, GPU, DPDK): When PR modifies fixtures for hardware-specific resources:
CRITICAL WORKFLOW COMPLETION RULES: When responding to this test execution plan request, you MUST follow these rules EXACTLY:
ABSOLUTE PROHIBITIONS (violating these creates empty/meaningless reviews):
Remember: The pull request review is visible to users. Additional comments are redundant noise. CRITICAL: Before setting "Run smoke tests: True", you MUST use shell scripts to: |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: Length of output: 2078 🏁 Script executed: Length of output: 1396 🏁 Script executed: Length of output: 1737 🧠 Learnings used |
yossisegev
left a comment
There was a problem hiding this comment.
Thank you Asia, this should significantly contribute to our stability.
|
/retest all Auto-triggered: Files in this PR were modified by merged PR #4662. Overlapping filestests/network/l2_bridge/test_bridge_nic_hot_plug.py |
yossisegev
left a comment
There was a problem hiding this comment.
Regardless of what this PR is aimed to achieve in terms of better debugging - I love the approach of unified method of creating the VMs (creating the SR-IOV VMs with the context of create_vm_for_hot_plug, just like the other VMs in the hot-plug module).
Thank you
|
/retest all Auto-triggered: Files in this PR were modified by merged PR #4772. Overlapping filestests/network/l2_bridge/libl2bridge.py |
test_connectivity_of_hot_plugged_sriov_interface is failing: VMInterfaceStatusNotFoundError: Network interface named sriov-hot-plug-test-network was not found in VM sriov-hot-plug-vm1 And VM1 must-gather logs are missing due to early teardown, which makes it difficult to debug and understand the root cause of the failure. VM1 is torndown by exit of Resource class (which VirtualMachineForTests inherits from). Context managers unwind as the exception propagates through the stack, before any outer exception handler (pytest's hook) can see it. Currently the same fixture creates the VM (via with VirtualMachineForTests(...)) and performs the hot-plug. When hot-plug fails, Python's exception propagation triggers VirtualMachineForTests.__exit__ (inherited from Resource), which deletes the VM before the exception reaches pytest's pytest_exception_interact hook. As a result, must-gather runs after the VM is already deleted and cannot capture its state. The fix is to create fixtures for VM creation and move SR-IOV interface hotplug to test- then must-gather runs right after setup/test error. Signed-off-by: Asia Khromov <azhivovk@redhat.com> Assisted-by: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Change: drop hotplug fixtures and perform hotplug in test |
|
/verified
|
Test execution plan request detailsCRITICAL: You MUST post an inline review comment on the first changed line of the first file. 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:
Hardware-Related Checks (SR-IOV, GPU, DPDK): When PR modifies fixtures for hardware-specific resources:
CRITICAL WORKFLOW COMPLETION RULES: When responding to this test execution plan request, you MUST follow these rules EXACTLY:
ABSOLUTE PROHIBITIONS (violating these creates empty/meaningless reviews):
Remember: The pull request review is visible to users. Additional comments are redundant noise. CRITICAL: Before setting "Run smoke tests: True", you MUST use shell scripts to: |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: Repository: RedHatQE/openshift-virtualization-tests 🏁 Script executed: Repository: RedHatQE/openshift-virtualization-tests 🏁 Script executed: Repository: RedHatQE/openshift-virtualization-tests 🏁 Script executed: Length of output: 100 🏁 Script executed: Repository: RedHatQE/openshift-virtualization-tests 🏁 Script executed: Repository: RedHatQE/openshift-virtualization-tests 🏁 Script executed: Repository: RedHatQE/openshift-virtualization-tests 🏁 Script executed: Repository: RedHatQE/openshift-virtualization-tests Test Execution Plan
|
|
/retest all Auto-triggered: Files in this PR were modified by merged PR #4950. Overlapping filestests/network/l2_bridge/libl2bridge.py |
|
/build-and-push-container |
|
New container for quay.io/openshift-cnv/openshift-virtualization-tests:pr-4660 published |
|
/retest all Auto-triggered: Files in this PR were modified by merged PR #4962. Overlapping filestests/network/l2_bridge/libl2bridge.py |
|
/retest all Auto-triggered: Files in this PR were modified by merged PR #4867. Overlapping filestests/network/l2_bridge/libl2bridge.py |
|
/approve |
|
/check-can-merge |
1 similar comment
|
/check-can-merge |
@azhivovk please fix the description |
|
Tip For best results, initiate chat on the files or code changes.
## Which issue(s) this PR fixes:
NONE
## Special notes for reviewer:
Split the SR-IOV hot-plug fixture into separate VM creation and hot-plug fixtures to ensure the VM is not torn down before must-gather can collect logs on setup failure.
## jira-ticket:
NONEAdd these sections to the PR description and the check should pass. |
|
@coderabbitai PR description is fixed |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
gh pr view 4660 --repo RedHatQE/openshift-virtualization-tests --json body -q '.body'Length of output: 2173
|
|
/retest all Auto-triggered: Files in this PR were modified by merged PR #4954. Overlapping filestests/network/l2_bridge/libl2bridge.py |
|
/retest tox |
|
Successfully removed PR tag: quay.io/openshift-cnv/openshift-virtualization-tests:pr-4660. |
|
New container for quay.io/openshift-cnv/openshift-virtualization-tests:latest published |
What this PR does / why we need it:
test_connectivity_of_hot_plugged_sriov_interfaceis failing:VMInterfaceStatusNotFoundError: Network interface named sriov-hot-plug-test-network was not found in VM sriov-hot-plug-vm1And VM1 must-gather logs are missing due to early teardown, which makes it difficult to debug and understand the root cause of the failure.
VM1 is torndown by exit of
Resourceclass (which VirtualMachineForTests inherits from).Context managers unwind as the exception propagates through the stack, before any outer exception handler (pytest's hook) can see it.
Currently the same fixture creates the VM (via with VirtualMachineForTests(...)) and performs the hot-plug. When hot-plug fails, Python's exception propagation triggers
VirtualMachineForTests.__exit__(inherited from Resource), which deletes the VM before the exception reaches pytest's pytest_exception_interact hook. As a result, must-gather runs after the VM is already deleted and cannot capture its state.Which issue(s) this PR fixes:
The fix is to create fixtures for VM creation and move SR-IOV interface hotplug to test - then must-gather
runs right after setup/test error.
Special notes for reviewer: -
jira-ticket: -
Summary by CodeRabbit