Skip to content

[virt] drop get_client() and force passing client arg#4916

Merged
dshchedr merged 7 commits into
RedHatQE:mainfrom
vsibirsk:vk-client-calls-remove
Jun 3, 2026
Merged

[virt] drop get_client() and force passing client arg#4916
dshchedr merged 7 commits into
RedHatQE:mainfrom
vsibirsk:vk-client-calls-remove

Conversation

@vsibirsk
Copy link
Copy Markdown
Collaborator

@vsibirsk vsibirsk commented May 19, 2026

What this PR does / why we need it:

clean-up last virt utils from using get_client() in wait_for_migration_finished and service_ip
function and method.
also refactor wait_for_migration_finished - take out failed pod logs to separate function

Which issue(s) this PR fixes:

Aligns last virt utilities with default client deprecation in python-wrapper repo
https://redhat.atlassian.net/browse/CNV-68519

Special notes for reviewer:
jira-ticket:

https://redhat.atlassian.net/browse/CNV-73714

Summary by CodeRabbit

  • Tests

    • Migration-related tests updated to use admin-aware IP resolution and the revised migration wait behavior (namespace passing simplified).
    • Added unit tests verifying the new migration-stuck diagnostic.
  • Refactor

    • Improved migration wait logic to better detect migrations stuck in Scheduling and surface richer diagnostic logs.
    • Service IP resolution now uses an admin-aware lookup and yields clearer errors when an IP cannot be determined.
  • Chores

    • Introduced a dedicated exception type for migrations stuck in Scheduling.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 19, 2026

Review Change Stack

📝 Walkthrough

Walkthrough

service_ip now requires an admin_client and uses privileged vmi.get_node; wait_for_migration_finished accepts only a migration object, detects prolonged SCHEDULING (~4 minutes), logs warning pod diagnostics, and raises MigrationStuckSchedulingError. Call sites and tests updated accordingly.

Changes

Service IP and Migration Waiting Refactoring

Layer / File(s) Summary
ServiceForVirtualMachineForTests.service_ip refactoring
utilities/virt.py
service_ip now requires admin_client: DynamicClient; node lookup uses vmi.get_node(privileged_client=admin_client) and ResourceValueError is raised when IP cannot be resolved; related imports added.
wait_for_migration_finished core refactor
utilities/virt.py
wait_for_migration_finished signature changed to accept migration: VirtualMachineInstanceMigration only; implements repeated SCHEDULING detection (~4 minutes), calls log_failed_pod_events, and raises MigrationStuckSchedulingError on stuck scheduling.
Call-site updates (tests & utilities)
tests/network/migration/test_migration.py, tests/scale/test_scale_benchmark.py, tests/utils.py, tests/virt/node/descheduler/conftest.py, tests/virt/utils.py, utilities/virt.py
Updated call sites to pass admin_client into service_ip where required and to invoke wait_for_migration_finished(migration=...) without an explicit namespace parameter. Test fixture test_migration_with_masquerade signature updated to include admin_client.
MigrationStuckSchedulingError and tests
utilities/exceptions.py, utilities/unittests/test_exceptions.py
Added MigrationStuckSchedulingError that stores migration_name and formats a Scheduling-stuck message; unit tests added and imports updated.

🎯 4 (Complex) | ⏱️ ~45 minutes

  • Suggested labels: new-tests
  • Suggested reviewers:
    • dshchedr
    • yossisegev
    • orelmisan
    • rnetser
    • nirdothan
    • EdDev
    • servolkov
    • RoniKishner
    • kbidarkar

🔕 Pre-merge checks override applied

The pre-merge checks have been overridden successfully. You can now proceed with the merge.

Overridden by @vsibirsk via checkbox on 2026-06-03T07:17:20.360Z.

❌ Failed checks (1 error)

Check name Status Explanation Resolution
Stp Link Required ❌ Error [IGNORED] TestMigrationStuckSchedulingError test class (lines 320-334 in utilities/unittests/test_exceptions.py) is newly added but lacks required STP/RFE/Jira links in docstrings. Add STP, RFE, or Jira link to TestMigrationStuckSchedulingError class or module docstring referencing the requirement tracking for migration stuck scheduling error testing (e.g., related to PR #4916 objectives or CNV-73714).
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed Title concisely describes the main change: removing get_client() calls and enforcing explicit client arguments in virt utilities.
Description check ✅ Passed Description covers all required template sections with clear explanations of what the PR does, which issue it fixes, and relevant Jira tickets.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ 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 and usage tips.

@openshift-virtualization-qe-bot-4
Copy link
Copy Markdown

Report bugs in Issues

Welcome! 🎉

This pull request will be automatically processed with the following features:

🔄 Automatic Actions

  • Reviewer Assignment: Reviewers are automatically assigned based on the OWNERS file in the repository root
  • Size Labeling: PR size labels (XS, S, M, L, XL, XXL) are automatically applied based on changes
  • Issue Creation: A tracking issue is created for this PR and will be closed when the PR is merged or closed
  • Branch Labeling: Branch-specific labels are applied to track the target branch
  • Auto-verification: Auto-verified users have their PRs automatically marked as verified
  • Labels: Enabled categories: branch, can-be-merged, cherry-pick, has-conflicts, hold, needs-rebase, size, verified, wip

📋 Available Commands

PR Status Management

  • /wip - Mark PR as work in progress (adds WIP: prefix to title)
  • /wip cancel - Remove work in progress status
  • /hold - Block PR merging (approvers only)
  • /hold cancel - Unblock PR merging
  • /verified - Mark PR as verified
  • /verified cancel - Remove verification status
  • /reprocess - Trigger complete PR workflow reprocessing (useful if webhook failed or configuration changed)
  • /regenerate-welcome - Regenerate this welcome message

Review & Approval

  • /lgtm - Approve changes (looks good to me)
  • /approve - Approve PR (approvers only)
  • /assign-reviewers - Assign reviewers based on OWNERS file
  • /assign-reviewer @username - Assign specific reviewer
  • /check-can-merge - Check if PR meets merge requirements

Testing & Validation

  • /retest tox - Run Python test suite with tox
  • /retest build-container - Rebuild and test container image
  • /retest verify-bugs-are-open - verify-bugs-are-open
  • /retest all - Run all available tests

Container Operations

  • /build-and-push-container - Build and push container image (tagged with PR number)
    • Supports additional build arguments: /build-and-push-container --build-arg KEY=value

Cherry-pick Operations

  • /cherry-pick <branch> - Schedule cherry-pick to target branch when PR is merged
    • Multiple branches: /cherry-pick branch1 branch2 branch3

Label Management

  • /<label-name> - Add a label to the PR
  • /<label-name> cancel - Remove a label from the PR

✅ Merge Requirements

This PR will be automatically approved when the following conditions are met:

  1. Approval: /approve from at least one approver
  2. LGTM Count: Minimum 2 /lgtm from reviewers
  3. Status Checks: All required status checks must pass
  4. No Blockers: No wip, hold, has-conflicts labels and PR must be mergeable (no conflicts)
  5. Verified: PR must be marked as verified

📊 Review Process

Approvers and Reviewers

Approvers:

  • EdDev
  • dshchedr
  • myakove
  • rnetser
  • vsibirsk

Reviewers:

  • Anatw
  • EdDev
  • RoniKishner
  • SamAlber
  • akri3i
  • azhivovk
  • dshchedr
  • frenzyfriday
  • geetikakay
  • guchen11
  • kbidarkar
  • nirdothan
  • orelmisan
  • rnetser
  • sarahbx
  • servolkov
  • vsibirsk
  • yossisegev
Available Labels
  • hold
  • verified
  • wip
  • lgtm
  • approve
AI Features
  • Cherry-Pick Conflict Resolution: Enabled (claude/claude-opus-4-6[1m])

💡 Tips

  • WIP Status: Use /wip when your PR is not ready for review
  • Verification: The verified label is removed on new commits unless the push is detected as a clean rebase
  • Cherry-picking: Cherry-pick labels are processed when the PR is merged
  • Container Builds: Container images are automatically tagged with the PR number
  • Permission Levels: Some commands require approver permissions
  • Auto-verified Users: Certain users have automatic verification and merge privileges

For more information, please refer to the project documentation or contact the maintainers.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.66%. Comparing base (a2dc143) to head (df635af).
⚠️ Report is 77 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4916      +/-   ##
==========================================
- Coverage   98.67%   98.66%   -0.02%     
==========================================
  Files          25       25              
  Lines        2487     2464      -23     
==========================================
- Hits         2454     2431      -23     
  Misses         33       33              
Flag Coverage Δ
utilities 98.66% <100.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

vsibirsk added 7 commits May 31, 2026 11:19
clean up last virt utils from using get_client()

Signed-off-by: vsibirsk <vsibirsk@redhat.com>
Signed-off-by: vsibirsk <vsibirsk@redhat.com>
Signed-off-by: vsibirsk <vsibirsk@redhat.com>
Signed-off-by: vsibirsk <vsibirsk@redhat.com>
Signed-off-by: vsibirsk <vsibirsk@redhat.com>
Signed-off-by: vsibirsk <vsibirsk@redhat.com>
move pod event collection to separate module-scope func
replaced/updated raised exceptions

Signed-off-by: vsibirsk <vsibirsk@redhat.com>
@openshift-virtualization-qe-bot
Copy link
Copy Markdown

Clean rebase detected — no code changes compared to previous head (7afa7cf).
The following labels were preserved: lgtm-coderabbitai[bot].

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
utilities/virt.py (1)

1957-1989: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

HIGH: Stop polling once the migration has already failed.

This loop only exits on Status.SUCCEEDED. If the VMIM reaches a terminal non-success phase, callers like migrate_vm_and_verify() and verify_hotplug() will still sit here until the outer timeout expires, turning an immediate migration failure into a 10–30 minute delay. Handle terminal failure phases explicitly and reserve the 4-minute SCHEDULING path for the stuck-pending case only.

🤖 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 `@utilities/exceptions.py`:
- Around line 134-138: MigrationStuckSchedulingError.__init__ currently only
sets self.migration_name so Exception.args is empty; update
MigrationStuckSchedulingError.__init__ to call super().__init__ with the error
message (e.g., super().__init__(str(self))) after setting self.migration_name so
the base Exception is initialized and exception.args contains the human-readable
message; refer to the MigrationStuckSchedulingError class and its __init__ and
__str__ methods when making this change.

In `@utilities/unittests/test_exceptions.py`:
- Around line 320-334: Extend the MigrationStuckSchedulingError test to assert
the exception's args tuple to lock the pickling-safe contract: in
test_migration_stuck_scheduling_error_init (or a new small test) add an
assertion like assert error.args == (migration_name,) so that if you later call
super().__init__(...) in utilities/exceptions.py the tests ensure args contains
the expected migration_name value (mirror the pattern used for
DataVolumeConditionMessageNotFoundError).
🪄 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: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 92251481-6071-4753-8e6c-182a3aa24a06

📥 Commits

Reviewing files that changed from the base of the PR and between aba9391 and df635af.

📒 Files selected for processing (8)
  • tests/network/migration/test_migration.py
  • tests/scale/test_scale_benchmark.py
  • tests/utils.py
  • tests/virt/node/descheduler/conftest.py
  • tests/virt/utils.py
  • utilities/exceptions.py
  • utilities/unittests/test_exceptions.py
  • utilities/virt.py
💤 Files with no reviewable changes (1)
  • tests/scale/test_scale_benchmark.py

Comment thread utilities/exceptions.py
Comment thread utilities/unittests/test_exceptions.py
@vsibirsk
Copy link
Copy Markdown
Collaborator Author

vsibirsk commented Jun 1, 2026

/verified

@openshift-virtualization-qe-bot-3
Copy link
Copy Markdown
Contributor

@coderabbitai

Test execution plan request details

CRITICAL: You MUST post an inline review comment on the first changed line of the first file.
The inline comment should contain the full Test Execution Plan (smoke decision, gating decision, and specific affected tests).
Do NOT submit a formal review - just post the inline comment directly.

As an expert software testing engineer, analyze all modified files in this PR and create a targeted test execution plan.
You will post an inline review comment with the test execution plan on the first changed file.
If you fail to run or post a comment, retry.

Analysis Requirements:

  1. Examine code changes in each modified file

  2. Identify affected code paths, functions, and classes

  3. Analyze pytest-specific elements: fixtures (scope, dependencies), parametrization, markers, conftest changes

  4. Trace test dependencies through imports, shared utilities, fixture inheritance, fixture teardown, and yield from cleanup in conftest

  5. Detect new tests introduced in the PR

  6. Utilities and libs impact (when utilities/ or libs/ changes):
    You MUST use shell scripts (rg, git diff) to trace the full impact.
    Follow these sub-steps in order:

    6a. Identify modified symbols: For each changed file under utilities/ or libs/,
    list every modified function or method.
    Example: git diff HEAD~1 --unified=0 -- utilities/hco.py | grep '^[+-]def '

    6b. Find direct callers: Search tests and conftest for each symbol from 6a.
    Example: rg -l 'get_hco_version' tests/

    6c. Trace fixture teardown and cleanup: Find fixtures that reach
    the modified symbol through yield from or context-manager wrappers.
    Example: rg -l 'yield from.*enable_common_boot|def.*enable_common_boot' tests/

    6d. Trace same-file callers: In each changed file, find other functions
    whose body calls a modified symbol (including code after yield
    in @contextmanager helpers).
    Example: rg 'get_hco_version|enable_common_boot' utilities/hco.py

    6e. Expand transitively: If function A calls modified B, then
    tests/fixtures that call A are affected — even when the test body
    never imports B directly.

    Do NOT limit impact to tests that import the modified symbol only.

  7. Smoke test impact: Intersect the affected set from step 6 with smoke-marked tests.
    Run: rg -l '@pytest.mark.smoke' tests/
    Set True ONLY if a smoke-marked file also appears in the affected set from 6b-6e.

  8. Gating test impact: Intersect the affected set from step 6 with gating-marked tests.
    Run: rg -l '@pytest.mark.gating' tests/
    Set True if a gating-marked file also appears in the affected set from 6b-6e.
    Utilities/libs changes often affect gating tests without affecting smoke tests.
    Do NOT stop analysis after concluding Run smoke tests: False.

Output rules:
Do NOT include analysis step numbers (1-8) in your visible output.

Your deliverable:
Your change request comment will be based on the following requirements:

Test Execution Plan

  • Run smoke tests: True / False — If True, state the dependency path (test → fixture → changed symbol). True ONLY with a verified path.
  • Run gating tests: True / False — If True, state the dependency path. True if any gating-marked test is in the affected set.
  • Affected tests to run (required when utilities/, libs/, or shared conftest changes — list concrete paths even when smoke is False)
  • path/to/test_file.py - When the entire test file needs verification
  • path/to/test_file.py::TestClass::test_method - When specific test(s) needed
  • path/to/test_file.py::test_function - When specific test(s) needed
  • -m marker - When a marker covers multiple affected tests (e.g. -m gating only if ALL gating tests in scope need run)
  • Tag each listed test or group with its marker when not obvious, e.g. (gating) or (smoke)

Guidelines:

  • Include tests affected directly OR via fixture setup/teardown, yield from cleanup, or transitive utility call chains (caller calls modified helper)
  • Use a full file path only if ALL tests in that file require verification
  • Use file path + test name when only specific tests use an affected fixture or utility wrapper (preferred for partial file impact)
  • If a test marker can cover multiple files/tests, provide the marker
  • Balance coverage vs over-testing - Keep descriptions minimal
  • Example: if leaf helper foo() changes, include tests whose fixture teardown calls wrapper bar() where bar() calls foo(), even when the test body only imports an unrelated symbol from the same utilities module

Hardware-Related Checks (SR-IOV, GPU, DPDK):

When PR modifies fixtures for hardware-specific resources:

  • Collection Safety: Fixtures MUST have existence checks (return None when hardware unavailable)
  • Test Plan: MUST verify both WITH and WITHOUT hardware:
    • Run affected tests on cluster WITH hardware
    • Verify collection succeeds on cluster WITHOUT hardware

CRITICAL WORKFLOW COMPLETION RULES:

When responding to this test execution plan request, you MUST follow these rules EXACTLY:

  1. YOUR ONLY DELIVERABLE: Post an inline review comment containing the test execution plan on the first changed line
  2. THEN STOP IMMEDIATELY - Do NOT generate any additional response
  3. FALLBACK ONLY: If submitting the review fails after retrying, post as a regular PR comment
  4. SILENCE = SUCCESS: After successfully submitting the review, your task is complete. No confirmation needed.

ABSOLUTE PROHIBITIONS (violating these creates empty/meaningless reviews):

  • ❌ Do NOT post acknowledgment messages like "Test execution plan posted", "Review posted successfully", "I've successfully posted"
  • ❌ Do NOT mention review IDs, URLs, or confirmation of posting in the PR thread
  • ❌ Do NOT add any follow-up comments after submitting the review
  • ❌ Do NOT reply to confirm task completion
  • ❌ Do NOT explain what you did - just do it and stop

Remember: The pull request review is visible to users. Additional comments are redundant noise.

CRITICAL — Verification rules for smoke and gating decisions:
- For each True decision, you must have traced a concrete path: test file → fixture → utility function → modified symbol.
- Do NOT assume impact based on scope, file proximity, or infrastructure-sounding names.
Only set True when you trace a concrete path through steps 6a-6e, then 7 or 8.
WRONG: "utilities/hco.py changed → run smoke" (no traced dependency path)
WRONG: "Run smoke tests: False" with no affected-test list when gating tests use the changed utility
RIGHT: "Run smoke tests: False, Run gating tests: True" plus tests/.../test_foo.py::TestBar::test_baz (gating)
RIGHT: "Smoke test X uses fixture Y → wrapper Z → changed function W in utilities/hco.py"

Comment thread tests/network/migration/test_migration.py
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 1, 2026

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
echo "=== Modified symbols in utilities/ ==="
git diff HEAD~1 --unified=0 -- utilities/virt.py | grep '^[+-]def ' | head -20
git diff HEAD~1 --unified=0 -- utilities/exceptions.py | grep '^[+-]def \|^[+-]class ' | head -20

echo ""
echo "=== Direct callers of wait_for_migration_finished ==="
rg -rn "wait_for_migration_finished" --type py -l

echo ""
echo "=== Direct callers of service_ip ==="
rg -rn "\.service_ip\(" --type py -l

echo ""
echo "=== Direct callers of log_failed_pod_events ==="
rg -rn "log_failed_pod_events" --type py -l

echo ""
echo "=== Direct callers of MigrationStuckSchedulingError ==="
rg -rn "MigrationStuckSchedulingError" --type py -l

echo ""
echo "=== Same-file callers in utilities/virt.py ==="
rg -n "wait_for_migration_finished\|service_ip\|log_failed_pod_events\|MigrationStuckSchedulingError" utilities/virt.py

echo ""
echo "=== Smoke-marked test files ==="
rg -rn "`@pytest.mark.smoke`" --type py -l

echo ""
echo "=== Gating-marked test files ==="
rg -rn "`@pytest.mark.gating`" --type py -l

echo ""
echo "=== Do any smoke files use wait_for_migration_finished or service_ip? ==="
smoke_files=$(rg -rn "`@pytest.mark.smoke`" --type py -l)
for f in $smoke_files; do
  if grep -q "wait_for_migration_finished\|service_ip\|MigrationStuckSchedulingError\|migrate_vm_and_verify\|migrate_and_verify_multi_vms\|verify_hotplug" "$f" 2>/dev/null; then
    echo "FOUND IN SMOKE: $f"
    grep -n "wait_for_migration_finished\|service_ip\|MigrationStuckSchedulingError\|migrate_vm_and_verify\|migrate_and_verify_multi_vms\|verify_hotplug" "$f"
  fi
done
echo "=== End smoke check ==="

echo ""
echo "=== Do any gating files use wait_for_migration_finished, service_ip, migrate_vm_and_verify, etc? ==="
gating_files=$(rg -rn "`@pytest.mark.gating`" --type py -l)
for f in $gating_files; do
  if grep -q "wait_for_migration_finished\|service_ip\|MigrationStuckSchedulingError\|migrate_vm_and_verify\|migrate_and_verify_multi_vms\|verify_hotplug" "$f" 2>/dev/null; then
    echo "FOUND IN GATING: $f"
    grep -n "wait_for_migration_finished\|service_ip\|MigrationStuckSchedulingError\|migrate_vm_and_verify\|migrate_and_verify_multi_vms\|verify_hotplug" "$f"
  fi
done
echo "=== End gating check ==="

echo ""
echo "=== PR head SHA and first file first changed line ==="
gh api repos/RedHatQE/openshift-virtualization-tests/pulls/4916 \
  --jq '{sha: .head.sha}'
gh api repos/RedHatQE/openshift-virtualization-tests/pulls/4916/files \
  --jq '.[0] | {filename: .filename, patch_first_lines: .patch[0:400]}'

Length of output: 11322


🏁 Script executed:

#!/bin/bash
curl -s -X POST \
  -H "Authorization: token ${GITHUB_TOKEN}" \
  -H "Accept: application/vnd.github.v3+json" \
  "https://api.github.com/repos/RedHatQE/openshift-virtualization-tests/pulls/4916/comments" \
  -d '{
    "commit_id": "df635af81269324014ccf4dc3a16b46e8a37b01b",
    "path": "tests/network/migration/test_migration.py",
    "side": "RIGHT",
    "line": 361,
    "body": "**Test Execution Plan**\n\n- **Run smoke tests: True** — `tests/infrastructure/instance_types/supported_os/test_rhel_os.py` (smoke) → `migrate_vm_and_verify` → `wait_for_migration_finished` (signature + behavior changed: new stuck-scheduling detection raises `MigrationStuckSchedulingError`). Same path for `tests/virt/cluster/common_templates/rhel/test_rhel_os_support.py` (smoke).\n- **Run gating tests: True** — Multiple gating tests → `migrate_vm_and_verify` → `wait_for_migration_finished` (changed); `tests/virt/cluster/resource_limits/test_auto_resource_limits.py` (gating) → `hotplug_spec_vm_and_verify_hotplug` → `verify_hotplug` (`tests/utils.py`) → `wait_for_migration_finished`.\n\n**Affected tests to run:**\n- `tests/network/migration/test_migration.py::test_migration_with_masquerade` — `service_ip` now requires `admin_client`.\n- `tests/scale/test_scale_benchmark.py::TestScale::test_mass_vm_live_migration` — direct caller of updated `wait_for_migration_finished`.\n- `tests/virt/node/descheduler/` — conftest `all_existing_migrations_completed` directly calls updated `wait_for_migration_finished`.\n- `tests/infrastructure/instance_types/supported_os/test_rhel_os.py` (smoke + gating) — transitive via `migrate_vm_and_verify`.\n- `tests/virt/cluster/common_templates/rhel/test_rhel_os_support.py` (smoke) — transitive via `migrate_vm_and_verify`.\n- `tests/network/migration/test_masquerade_connectivity_after_migration.py` (gating) — transitive via `migrate_vm_and_verify`.\n- `tests/virt/cluster/migration_and_maintenance/test_migration_policy.py` (gating) — transitive via `migrate_vm_and_verify`.\n- `tests/virt/cluster/vm_lifecycle/test_vm_run_strategy.py` (gating) — transitive via `migrate_vm_and_verify`.\n- `tests/virt/upgrade/test_upgrade_virt.py` (gating) — transitive via `migrate_vm_and_verify`.\n- `tests/storage/test_hotplug.py` (gating) — transitive via `migrate_vm_and_verify` and `verify_hotplug`.\n- `tests/virt/cluster/resource_limits/test_auto_resource_limits.py` (gating) — transitive via `hotplug_spec_vm_and_verify_hotplug` → `verify_hotplug` → `wait_for_migration_finished`.\n- `-m migration` — covers remaining callers of `wait_for_migration_finished` via `migrate_and_verify_multi_vms` in `tests/virt/utils.py`."
  }' | python3 -c "import sys,json; d=json.load(sys.stdin); print('id:', d.get('id'), 'url:', d.get('html_url'))" 2>&1

Length of output: 2838


🏁 Script executed:

#!/bin/bash
# Check actual error with raw response first
curl -s -X POST \
  -H "Authorization: token ${GITHUB_TOKEN}" \
  -H "Accept: application/vnd.github.v3+json" \
  "https://api.github.com/repos/RedHatQE/openshift-virtualization-tests/pulls/4916/comments" \
  -d '{
    "commit_id": "df635af81269324014ccf4dc3a16b46e8a37b01b",
    "path": "tests/network/migration/test_migration.py",
    "side": "RIGHT",
    "line": 361,
    "body": "**Test Execution Plan**\n\n- **Run smoke tests: True** — `tests/infrastructure/instance_types/supported_os/test_rhel_os.py` (smoke) \u2192 `migrate_vm_and_verify` \u2192 `wait_for_migration_finished` (signature + behavior changed: new stuck-scheduling detection raises `MigrationStuckSchedulingError`). Same path for `tests/virt/cluster/common_templates/rhel/test_rhel_os_support.py` (smoke).\n- **Run gating tests: True** — Multiple gating tests \u2192 `migrate_vm_and_verify` \u2192 `wait_for_migration_finished` (changed); `tests/virt/cluster/resource_limits/test_auto_resource_limits.py` (gating) \u2192 `hotplug_spec_vm_and_verify_hotplug` \u2192 `verify_hotplug` \u2192 `wait_for_migration_finished`.\n\n**Affected tests to run:**\n- `tests/network/migration/test_migration.py::test_migration_with_masquerade`\n- `tests/scale/test_scale_benchmark.py::TestScale::test_mass_vm_live_migration`\n- `tests/virt/node/descheduler/` (conftest `all_existing_migrations_completed`)\n- `tests/infrastructure/instance_types/supported_os/test_rhel_os.py` (smoke + gating)\n- `tests/virt/cluster/common_templates/rhel/test_rhel_os_support.py` (smoke)\n- `tests/network/migration/test_masquerade_connectivity_after_migration.py` (gating)\n- `tests/virt/cluster/migration_and_maintenance/test_migration_policy.py` (gating)\n- `tests/virt/cluster/vm_lifecycle/test_vm_run_strategy.py` (gating)\n- `tests/virt/upgrade/test_upgrade_virt.py` (gating)\n- `tests/storage/test_hotplug.py` (gating)\n- `tests/virt/cluster/resource_limits/test_auto_resource_limits.py` (gating)\n- `-m migration`"
  }' 2>&1 | head -100

Length of output: 2197


🏁 Script executed:

#!/bin/bash
gh api repos/RedHatQE/openshift-virtualization-tests/pulls/4916/comments \
  --method POST \
  -f commit_id="df635af81269324014ccf4dc3a16b46e8a37b01b" \
  -f path="tests/network/migration/test_migration.py" \
  -f side="RIGHT" \
  -F line=361 \
  -f body="**Test Execution Plan**

- **Run smoke tests: True** — \`tests/infrastructure/instance_types/supported_os/test_rhel_os.py\` (smoke) → \`migrate_vm_and_verify\`\`wait_for_migration_finished\` (signature + behavior changed: new stuck-scheduling detection raises \`MigrationStuckSchedulingError\`). Same path for \`tests/virt/cluster/common_templates/rhel/test_rhel_os_support.py\` (smoke).
- **Run gating tests: True** — Multiple gating tests → \`migrate_vm_and_verify\`\`wait_for_migration_finished\` (changed); \`tests/virt/cluster/resource_limits/test_auto_resource_limits.py\` (gating) → \`hotplug_spec_vm_and_verify_hotplug\`\`verify_hotplug\` (\`tests/utils.py\`) → \`wait_for_migration_finished\`.

**Affected tests to run:**
- \`tests/network/migration/test_migration.py::test_migration_with_masquerade\`\`service_ip\` now requires \`admin_client\`
- \`tests/scale/test_scale_benchmark.py::TestScale::test_mass_vm_live_migration\` — direct caller of updated \`wait_for_migration_finished\`
- \`tests/virt/node/descheduler/\` — conftest \`all_existing_migrations_completed\` directly calls updated \`wait_for_migration_finished\`
- \`tests/infrastructure/instance_types/supported_os/test_rhel_os.py\` (smoke + gating) — transitive via \`migrate_vm_and_verify\`
- \`tests/virt/cluster/common_templates/rhel/test_rhel_os_support.py\` (smoke) — transitive via \`migrate_vm_and_verify\`
- \`tests/network/migration/test_masquerade_connectivity_after_migration.py\` (gating) — transitive via \`migrate_vm_and_verify\`
- \`tests/virt/cluster/migration_and_maintenance/test_migration_policy.py\` (gating) — transitive via \`migrate_vm_and_verify\`
- \`tests/virt/cluster/vm_lifecycle/test_vm_run_strategy.py\` (gating) — transitive via \`migrate_vm_and_verify\`
- \`tests/virt/upgrade/test_upgrade_virt.py\` (gating) — transitive via \`migrate_vm_and_verify\`
- \`tests/storage/test_hotplug.py\` (gating) — transitive via \`migrate_vm_and_verify\` and \`verify_hotplug\`
- \`tests/virt/cluster/resource_limits/test_auto_resource_limits.py\` (gating) — transitive via \`hotplug_spec_vm_and_verify_hotplug\`\`verify_hotplug\`\`wait_for_migration_finished\`
- \`-m migration\` — covers remaining callers via \`migrate_and_verify_multi_vms\` in \`tests/virt/utils.py\`" \
  --jq '{id: .id, url: .html_url}' 2>&1

Length of output: 2806



The Test Execution Plan has been posted as an inline review comment on line 361 of tests/network/migration/test_migration.py (view comment).

Copy link
Copy Markdown
Collaborator

@rnetser rnetser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve
/lgtm

@openshift-virtualization-qe-bot-3
Copy link
Copy Markdown
Contributor

/retest all

Auto-triggered: Files in this PR were modified by merged PR #4954.

Overlapping files

tests/scale/test_scale_benchmark.py
tests/utils.py
tests/virt/node/descheduler/conftest.py
tests/virt/utils.py
utilities/exceptions.py

@vsibirsk
Copy link
Copy Markdown
Collaborator Author

vsibirsk commented Jun 2, 2026

/retest tox

@openshift-virtualization-qe-bot-3
Copy link
Copy Markdown
Contributor

/retest all

Auto-triggered: Files in this PR were modified by merged PR #5030.

Overlapping files

tests/virt/node/descheduler/conftest.py

@dshchedr
Copy link
Copy Markdown
Collaborator

dshchedr commented Jun 3, 2026

/approve

@vsibirsk
Copy link
Copy Markdown
Collaborator Author

vsibirsk commented Jun 3, 2026

/check-can-merge

@openshift-virtualization-qe-bot-2
Copy link
Copy Markdown
Contributor

New container for quay.io/openshift-cnv/openshift-virtualization-tests:latest published

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants