Skip to content

[STORGE][GATING] Add retry for virtctl download to handle transient SSL errors#5346

Open
Ahmad-Hafe wants to merge 1 commit into
RedHatQE:cnv-4.22from
Ahmad-Hafe:add-retry-to-virtctl-download-4.22
Open

[STORGE][GATING] Add retry for virtctl download to handle transient SSL errors#5346
Ahmad-Hafe wants to merge 1 commit into
RedHatQE:cnv-4.22from
Ahmad-Hafe:add-retry-to-virtctl-download-4.22

Conversation

@Ahmad-Hafe

@Ahmad-Hafe Ahmad-Hafe commented Jun 23, 2026

Copy link
Copy Markdown
Contributor
What this PR does / why we need it:

The virtctl binary download from the cluster CLI route can fail with SSLEOFError during TLS handshake, causing all tests depending on the virtctl_binary fixture to fail in setup.

Wraps the download in TimeoutSampler to retry on SSLError and ConnectionError for up to 2 minutes (10s between attempts).

Which issue(s) this PR fixes:

Cherry-pick source for https://github.com/RedHatQE/cnv-tests/pull/3497

Special notes for reviewer:
jira-ticket:

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

The virtctl binary download from the cluster CLI route can fail with
SSLEOFError during TLS handshake, causing all tests depending on the
virtctl_binary fixture to fail in setup. Wrap the download in
TimeoutSampler to retry on SSLError and ConnectionError for up to
2 minutes (10s between attempts).

Signed-off-by: Ahmad Hafe <ahafe@redhat.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (5)
  • main
  • cnv-4.21
  • cnv-4.20
  • cnv-4.19
  • cnv-4.18

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 706a5cd9-8231-4283-9880-43a2200a934a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ 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.

@Ahmad-Hafe

Copy link
Copy Markdown
Contributor Author

/build-and-push-container

@openshift-virtualization-qe-bot-2

Copy link
Copy Markdown
Contributor

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

@Ahmad-Hafe

Copy link
Copy Markdown
Contributor Author

/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 blocking review event (REQUEST_CHANGES/APPROVE).
Post a single inline PR comment on Files Changed (non-blocking COMMENT flow).

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/
    VERIFY the above command returned actual file paths before concluding False.
    Set True if either condition is met:

    • a smoke-marked file appears in the affected set from 6b-6e, OR
    • any conftest.py in the smoke test's parent-directory hierarchy (up to repo root)
      imports or calls a modified utilities/libs symbol — including autouse fixtures
      that depend on modified functions. ALL tests in that directory and below are affected.
      Example check: for each smoke_file, scan dirname(smoke_file)/conftest.py,
      dirname(dirname(smoke_file))/conftest.py, etc. for modified symbol imports
      and autouse fixtures that depend on modified symbols.
  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 inline informational 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)

Use these formats:

  • 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)

Real test commands (MANDATORY when changes affect session/runtime code):

When the affected code runs at session/collection time (conftest fixtures, pytest plugins,
config hooks, session-scoped setup) or modifies runtime behavior that unit tests mock away,
you MUST include concrete pytest commands the PR author must run on a real cluster
to verify the change works end-to-end. Include:

  • A command for the error/fix path (the scenario the PR fixes)
  • A command for the happy path (regression: the normal case still works)
  • Use lightweight tests (e.g., --collect-only for startup failures,
    a single small test for runtime behavior)
    If the PR only changes test logic (not utilities/libs/conftest), the affected test
    paths themselves serve as the real test commands — no separate section needed.

Example output for a session-startup fix:

**Real tests (cluster required)**
Error path (the fix):
`pytest tests/storage/.../test_foo.py --storage-class-matrix=nonexistent-sc --collect-only`
Expected: ValueError with clear message, not IndexError

Happy path (regression):
`pytest tests/storage/.../test_foo.py --storage-class-matrix=<valid-sc> -k test_bar`
Expected: session starts normally

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 one non-blocking inline 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 inline comment API calls fail 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 utilities/infra.py
@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Tip

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

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "=== PR METADATA ==="
gh pr view 5346 --json number,headRefOid,baseRefName,headRefName,files --jq '{number, headRefOid, baseRefName, headRefName, files: [.files[] | {path, additions, deletions}]}'

echo
echo "=== CHANGED FILES ==="
git diff --name-status origin/main...HEAD || git diff --name-status HEAD~1...HEAD

echo
echo "=== FIRST CHANGED FILE/PATCH INFO ==="
first_file="$(git diff --name-only origin/main...HEAD | head -n1 || true)"
if [[ -z "${first_file}" ]]; then
  first_file="$(git diff --name-only HEAD~1...HEAD | head -n1 || true)"
fi
echo "first_file=${first_file}"
if [[ -n "${first_file}" ]]; then
  git diff --unified=0 origin/main...HEAD -- "${first_file}" || git diff --unified=0 HEAD~1...HEAD -- "${first_file}"
fi

echo
echo "=== FULL DIFF UNIFIED=80 ==="
git diff --unified=80 origin/main...HEAD || git diff --unified=80 HEAD~1...HEAD

echo
echo "=== MODIFIED SYMBOLS IN UTILITIES/LIBS (if any) ==="
for f in $(git diff --name-only origin/main...HEAD | grep -E '^(utilities|libs)/' || true); do
  echo "--- $f"
  git diff --unified=0 origin/main...HEAD -- "$f" | grep -E '^[+-][[:space:]]*(def|class)[[:space:]]+' || true
done

echo
echo "=== SEARCH virtctl_binary DEFINITIONS/USES ==="
rg -n -C3 '\bvirtctl_binary\b' . || true

echo
echo "=== SEARCH download/import/retry symbols around virtctl ==="
rg -n -C3 '\b(virtctl|download|TimeoutSampler|SSLError|ConnectionError)\b' tests utilities libs conftest.py 2>/dev/null || true

echo
echo "=== PYTEST MARKER FILES ==="
echo "--- smoke files"
rg -n -l '`@pytest`\.mark\.smoke' tests || true
echo "--- gating files"
rg -n -l '`@pytest`\.mark\.gating' tests || true

echo
echo "=== MARKERS IN FILES MENTIONING virtctl_binary ==="
while IFS= read -r f; do
  [[ -f "$f" ]] || continue
  echo "--- $f"
  rg -n -C2 '`@pytest`\.mark\.(smoke|gating)|virtctl_binary|def test_|class Test' "$f" || true
done < <(rg -l '\bvirtctl_binary\b' tests conftest.py utilities libs 2>/dev/null || true)

echo
echo "=== CONFTSTS WITH virtctl/download-related SYMBOLS ==="
fd '^conftest\.py$' . -x sh -c 'rg -n -C3 "\b(virtctl_binary|virtctl|TimeoutSampler|download)\b" "$1" && echo "--- $1"' sh {} 2>/dev/null || true

echo
echo "=== COLLECT TEST FUNCTIONS USING virtctl_binary PARAM/FIXTURE ==="
python - <<'PY'
import os, re
for root, dirs, files in os.walk("tests"):
    dirs[:] = [d for d in dirs if d not in {".git", "__pycache__"}]
    for name in files:
        if not name.endswith(".py"):
            continue
        path=os.path.join(root,name)
        try:
            text=open(path,encoding="utf-8").read()
        except Exception:
            continue
        if "virtctl_binary" not in text:
            continue
        print(f"--- {path}")
        lines=text.splitlines()
        current_class=None
        decorators=[]
        for i,line in enumerate(lines, start=1):
            mcls=re.match(r'^class\s+(\w+)', line)
            if mcls:
                current_class=mcls.group(1)
            if line.strip().startswith("@"):
                decorators.append((i,line.strip()))
                continue
            m=re.match(r'^\s*def\s+(test_\w+)\s*\(([^)]*)', line)
            if m:
                func=m.group(1); params=m.group(2)
                block="\n".join(lines[max(0,i-8):min(len(lines),i+25)])
                if "virtctl_binary" in params or "virtctl_binary" in block:
                    q=f"{path}::{current_class+'::' if current_class else ''}{func}"
                    marks=[d for _,d in decorators if "pytest.mark" in d]
                    print(f"{i}: {q} params=({params}) marks={marks}")
                decorators=[]
            elif line.strip() and not line.strip().startswith("#"):
                decorators=[]
PY

Length of output: 202021


🏁 Script executed:

#!/bin/bash
set -euo pipefail

BASE="$(git merge-base origin/main HEAD 2>/dev/null || git rev-parse HEAD~1)"
echo "BASE=$BASE"
echo "HEAD=$(git rev-parse HEAD)"

echo "=== PR META ==="
gh pr view 5346 --json headRefOid,files --jq '{headRefOid, files: [.files[] | {path, additions, deletions}]}'

echo "=== CHANGED FILES ==="
git diff --name-status "$BASE"...HEAD

echo "=== FIRST FILE PATCH ==="
first_file="$(git diff --name-only "$BASE"...HEAD | head -n1)"
echo "FIRST_FILE=$first_file"
git diff --unified=0 "$BASE"...HEAD -- "$first_file" | sed -n '1,120p'

echo "=== FULL TARGETED DIFF ==="
git diff --unified=30 "$BASE"...HEAD

echo "=== MODIFIED SYMBOLS ==="
for f in $(git diff --name-only "$BASE"...HEAD | grep -E '^(utilities|libs|tests)/|^conftest\.py$' || true); do
  echo "--- $f"
  git diff --unified=0 "$BASE"...HEAD -- "$f" | grep -E '^[+-][[:space:]]*(def|class)[[:space:]]+' || true
done

echo "=== virtctl_binary DEFINITIONS/USES CONCISE ==="
rg -n -C2 '\bvirtctl_binary\b' tests conftest.py utilities libs 2>/dev/null || true

echo "=== run_virtctl_command DEFINITIONS/USES CONCISE ==="
rg -n -C2 '\brun_virtctl_command\b' tests conftest.py utilities libs 2>/dev/null || true

echo "=== REQUESTS/URLRETRIEVE/TimeoutSampler IN CHANGED FILES ==="
for f in $(git diff --name-only "$BASE"...HEAD); do
  echo "--- $f"
  rg -n -C3 '\b(TimeoutSampler|SSLError|ConnectionError|requests|urlretrieve|urlopen|download|virtctl)\b' "$f" || true
done

echo "=== TEST FUNCTIONS AND MARKERS IN FILES WITH virtctl_binary ==="
python - <<'PY'
import ast, os, re
paths=[]
for root, dirs, files in os.walk("tests"):
    dirs[:] = [d for d in dirs if d not in {".git","__pycache__"}]
    for name in files:
        if name.endswith(".py"):
            p=os.path.join(root,name)
            try:
                txt=open(p, encoding="utf-8").read()
            except Exception:
                continue
            if "virtctl_binary" in txt:
                paths.append(p)
for p in sorted(paths):
    print(f"--- {p}")
    txt=open(p, encoding="utf-8").read()
    tree=ast.parse(txt)
    module_marks=[]
    for node in tree.body:
        if isinstance(node, ast.Assign):
            pass
    def mark_names(decos):
        out=[]
        for d in decos:
            s=ast.unparse(d) if hasattr(ast, "unparse") else ""
            if "pytest.mark." in s:
                out.append(s)
        return out
    for node in tree.body:
        if isinstance(node, ast.FunctionDef) and node.name.startswith("test_"):
            params=[a.arg for a in node.args.args]
            body=ast.get_source_segment(txt,node) or ""
            if "virtctl_binary" in params or "virtctl_binary" in body:
                print(f"{p}::{node.name} params={params} marks={mark_names(node.decorator_list)}")
        if isinstance(node, ast.ClassDef):
            cmarks=mark_names(node.decorator_list)
            for item in node.body:
                if isinstance(item, ast.FunctionDef) and item.name.startswith("test_"):
                    params=[a.arg for a in item.args.args]
                    body=ast.get_source_segment(txt,item) or ""
                    if "virtctl_binary" in params or "virtctl_binary" in body:
                        print(f"{p}::{node.name}::{item.name} params={params} class_marks={cmarks} marks={mark_names(item.decorator_list)}")
PY

echo "=== MARKERS IN virtctl_binary FILES ==="
for f in $(rg -l '\bvirtctl_binary\b' tests 2>/dev/null || true); do
  echo "--- $f"
  rg -n '`@pytest`\.mark\.(smoke|gating|polarion|tier|destructive|s390x)|pytestmark|virtctl_binary|def test_|class Test' "$f" || true
done

echo "=== CONFTST HIERARCHY FOR SMOKE/GATING FILES WITH changed symbol terms ==="
python - <<'PY'
import os, subprocess
smoke = subprocess.run(["rg","-l","`@pytest`\\.mark\\.smoke","tests"], text=True, capture_output=True).stdout.splitlines()
gating = subprocess.run(["rg","-l","`@pytest`\\.mark\\.gating","tests"], text=True, capture_output=True).stdout.splitlines()
terms=["virtctl_binary","download_virtctl_binary","TimeoutSampler","requests.get"]
for label, files in [("smoke",smoke),("gating",gating)]:
    print(f"-- {label} count={len(files)}")
    for f in files:
        d=os.path.dirname(f)
        seen=[]
        while True:
            cf=os.path.join(d,"conftest.py") if d else "conftest.py"
            if os.path.exists(cf) and cf not in seen:
                txt=open(cf,encoding="utf-8").read(errors="ignore")
                hits=[t for t in terms if t in txt]
                if hits:
                    print(f"{label}: {f} hierarchy_conftest={cf} hits={hits}")
                seen.append(cf)
            if d in ("", "."):
                break
            nd=os.path.dirname(d)
            if nd==d:
                break
            d=nd
PY

Length of output: 27846


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "=== utilities/infra.py changed call chain snippets ==="
sed -n '665,725p' utilities/infra.py

echo "=== tests/conftest.py virtctl fixtures/imports snippets ==="
sed -n '130,170p' tests/conftest.py
sed -n '1455,1480p' tests/conftest.py
sed -n '1900,1950p' tests/conftest.py
rg -n -C2 '\b(get_and_extract_file_from_cluster|download_and_extract_file_from_cluster|virtctl_binary|bin_directory_to_os_path)\b' tests/conftest.py

echo "=== console cli download conftest/test snippets ==="
sed -n '1,130p' tests/install_upgrade_operators/console_cli_download/conftest.py
sed -n '1,140p' tests/install_upgrade_operators/console_cli_download/test_disconnected_virtctl.py

echo "=== direct callers of changed and transitive symbols ==="
rg -n -C2 '\b(download_and_extract_file_from_cluster|get_and_extract_file_from_cluster)\b' tests utilities libs conftest.py 2>/dev/null || true

echo "=== smoke/gating conftest hierarchy hits for exact changed/transitive symbols ==="
python - <<'PY'
import os, subprocess
terms=["download_and_extract_file_from_cluster","get_and_extract_file_from_cluster"]
for label, pattern in [("smoke", "`@pytest`\\.mark\\.smoke"), ("gating", "`@pytest`\\.mark\\.gating")]:
    files=subprocess.run(["rg","-l",pattern,"tests"], text=True, capture_output=True).stdout.splitlines()
    print(f"-- {label} files={len(files)}")
    for f in files:
        d=os.path.dirname(f)
        while True:
            cf=os.path.join(d,"conftest.py") if d else "conftest.py"
            if os.path.exists(cf):
                txt=open(cf,encoding="utf-8",errors="ignore").read()
                hits=[t for t in terms if t in txt]
                if hits:
                    print(f"{label}: {f} hierarchy_conftest={cf} hits={hits}")
            if d in ("", "."):
                break
            nd=os.path.dirname(d)
            if nd == d:
                break
            d = nd
PY

echo "=== markers for affected console cli download tests ==="
rg -n '`@pytest`\.mark\.(smoke|gating|polarion|arm64|tier)|pytestmark|class Test|def test_' tests/install_upgrade_operators/console_cli_download/test_disconnected_virtctl.py tests/install_upgrade_operators/console_cli_download/conftest.py

Length of output: 21956


🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo="RedHatQE/openshift-virtualization-tests"
pr_number="5346"
commit_id="4eadff212d10c02b338502fdaaf6418d46cd603f"
path="utilities/infra.py"
line="692"

body="$(cat <<'EOF'
**Test Execution Plan**

- **Run smoke tests: False** — Verified smoke-marked files exist, but no smoke file or smoke parent-directory `conftest.py` imports/calls `download_and_extract_file_from_cluster` or its transitive caller `get_and_extract_file_from_cluster`.
- **Run gating tests: True** — `tests/install_upgrade_operators/console_cli_download/test_disconnected_virtctl.py` is module-marked `gating`; affected path: test → `downloaded_and_extracted_virtctl_binary_for_os` fixture → `utilities.infra.get_and_extract_file_from_cluster` → changed `utilities.infra.download_and_extract_file_from_cluster` retry wrapper around `requests.get`.

**Affected tests to run**
- `tests/install_upgrade_operators/console_cli_download/test_disconnected_virtctl.py::TestDisconnectedVirtctlDownload::test_download_virtcli_binary` (gating)
- `tests/install_upgrade_operators/console_cli_download/test_disconnected_virtctl.py::TestDisconnectedVirtctlDownloadAndExecute::test_download_and_execute_virtcli_binary_linux` (gating)
- `tests/install_upgrade_operators/console_cli_download/test_custom_console_cli_download.py` — direct import/use of `download_and_extract_file_from_cluster`.
- A lightweight session-fixture regression using any small non-installing test that requires `bin_directory_to_os_path`, because `tests/conftest.py` session fixture `virtctl_binary` uses `download_file_from_cluster` → `get_and_extract_file_from_cluster` → changed `download_and_extract_file_from_cluster`.

**Real tests (cluster required)**

Error path (the fix):
`pytest tests/install_upgrade_operators/console_cli_download/test_disconnected_virtctl.py::TestDisconnectedVirtctlDownload::test_download_virtcli_binary -k linux_amd64`
Expected: transient `requests.exceptions.SSLError` / `requests.exceptions.ConnectionError` from the cluster CLI download route is retried for up to 2 minutes instead of failing fixture setup immediately.

Happy path (regression):
`pytest tests/install_upgrade_operators/console_cli_download/test_disconnected_virtctl.py::TestDisconnectedVirtctlDownloadAndExecute::test_download_and_execute_virtcli_binary_linux -k linux_amd64`
Expected: archive download, extraction, and `virtctl version` execution still succeed with the new `TimeoutSampler` wrapper.
EOF
)"

payload="$(jq -n \
  --arg body "$body" \
  --arg commit_id "$commit_id" \
  --arg path "$path" \
  --argjson line "$line" \
  '{body:$body, commit_id:$commit_id, path:$path, line:$line, side:"RIGHT"}')"

for attempt in 1 2; do
  if gh api \
    --method POST \
    -H "Accept: application/vnd.github+json" \
    "repos/${repo}/pulls/${pr_number}/comments" \
    --input - <<<"$payload" >/tmp/inline-comment-result.json; then
    exit 0
  fi
  sleep 2
done

gh pr comment "$pr_number" --repo "$repo" --body "$body" >/tmp/fallback-pr-comment-result.txt

Length of output: 3163



@Ahmad-Hafe

Copy link
Copy Markdown
Contributor Author

/retest tox

@Ahmad-Hafe

Copy link
Copy Markdown
Contributor Author

/retest all

1 similar comment
@Ahmad-Hafe

Copy link
Copy Markdown
Contributor Author

/retest all

@ema-aka-young

Copy link
Copy Markdown
Contributor

Shouldn't this point to main?

@rnetser

rnetser commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

/approve
/lgtm

@Ahmad-Hafe

Copy link
Copy Markdown
Contributor Author

@ema-aka-young main have problem in Run Utilities Unit Tests CI
#5355

@rnetser

rnetser commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

/approve cancel
/lgtm cancel

missed that this is on 4.22

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.

10 participants