Skip to content

[Storage] Increase libguestfs pod timeout#5308

Merged
rnetser merged 1 commit into
RedHatQE:mainfrom
ema-aka-young:increase-libguestfs-timeout
Jun 25, 2026
Merged

[Storage] Increase libguestfs pod timeout#5308
rnetser merged 1 commit into
RedHatQE:mainfrom
ema-aka-young:increase-libguestfs-timeout

Conversation

@ema-aka-young

@ema-aka-young ema-aka-young commented Jun 22, 2026

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

Increase the timeout from TIMEOUT_1MIN (60s) to TIMEOUT_10MIN (600s) to match the product's own 500-second timeout for the libguestfs pod to reach Running state. The product code at pkg/virtctl/guestfs/guestfs.go defines timeout = 500 * time.Second for this same operation.

Which issue(s) this PR fixes:

Test failures on different lanes.

Special notes for reviewer:
jira-ticket:

CNV-62312

Summary by CodeRabbit

  • Tests
    • Improved reliability of pod readiness checks by increasing the wait timeout when using libguestfs-tools-* in the virtctl_libguestfs_by_user fixture.

@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: f8752a1f-95c1-43a7-8223-5e91d979b439

📥 Commits

Reviewing files that changed from the base of the PR and between af75449 and f405e94.

📒 Files selected for processing (1)
  • tests/storage/test_libguestfs.py

📝 Walkthrough

Walkthrough

In tests/storage/test_libguestfs.py, the TIMEOUT_10MIN constant is added to the imports and replaces TIMEOUT_1MIN as the timeout value passed to libguestfs_pod.wait_for_status() inside the virtctl_libguestfs_by_user fixture. Import block formatting is also adjusted.

Changes

Libguestfs Pod Wait Timeout

Layer / File(s) Summary
Import and fixture wait timeout change
tests/storage/test_libguestfs.py
TIMEOUT_10MIN is imported alongside TIMEOUT_1MIN and substituted into the wait_for_status call waiting for the libguestfs-tools-* pod to reach RUNNING status.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

Suggested reviewers

  • kgoldbla
  • kshvaika
  • Ahmad-Hafe
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: increasing the libguestfs pod timeout in storage tests.
Description check ✅ Passed The description covers all required sections with clear context, rationale, and references to product code alignment and the associated Jira ticket.
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.
Stp Link Required ✅ Passed No new test files or test functions were added in this PR — only existing fixture and imports were modified. Per check instructions, this satisfies the requirement to pass.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

Review ran into problems

🔥 Problems

Linked repositories: Your configuration references 1 linked repositories, but your current plan allows 0. Analyzed ``, skipped RedHatQE/openshift-virtualization-tests-design-docs.


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.

@ema-aka-young ema-aka-young changed the title [Storage] Increase libguestfs timeout [Storage] Increase libguestfs pod timeout Jun 22, 2026
@ema-aka-young ema-aka-young marked this pull request as ready for review June 22, 2026 14:15
@openshift-virtualization-qe-bot

Copy link
Copy Markdown

Verification failed for PR #5308.
The pipeline did not reach the test execution stage.

Execution details
pytest -s -o log_cli=true -m tier2 --jira --skip-deprecated-api-test --cluster-sanity-skip-check -k test_virtctl_libguestfs_with_specific_user --storage-class-matrix=ocs-storagecluster-ceph-rbd-virtualization
(1 parameters hidden from public report)
Image: openshift-virtualization-tests:pr-5308

@josemacassan

Copy link
Copy Markdown
Contributor

/lgtm

@akalenyu

Copy link
Copy Markdown

@akalenyu

So IIUC just pulling the image could take up to 10 minutes? That sounds a bit off, how big is the image? You could try crictl on the ocp node and we could compare it to upstream. Just want to make sure we don't have a huge issue somewhere.

[cloud-user@worker1 ~]$ oc debug node/cnvqe-057.lab.eng.tlv2.redhat.com -- chroot /host crictl images | grep libguestfs
Starting pod/cnvqe-057labengtlv2redhatcom-debug-splbz ...
To use host binaries, run `chroot /host`. Instead, if you need to access host namespaces, run `nsenter -a -t 1`.

Removing debug pod ...
registry.redhat.io/container-native-virtualization/libguestfs-tools-rhel9                  <none>                                         0bc2221f5c35a       660MB

I could not pull the image for upstream but checking https://quay.io/repository/kubevirt/libguestfs-tools?tab=tags&tag=latest it looks to be 570MB.

Anyway, I think the timeout set to 10Min is conservative as it covering not only the pull of the image but also other operations that needs to be successful to have a Running Container. Replicating this manually, it never took more than 2/3 minutes but I wanted to align the test timeout with the production code.

There is not much happening other than the pull tbh, the entrypoint is bash

- Quarantine libguestfs test due to intermittent failures
- Add jira reference for tracking
- Increase libguestfs timeout to 10 minutes to align with production code
- Use unprivileged client in pod watcher
- Update docstring for virtctl guestfs test to improve clarity

Signed-off-by: Emanuele Prella <eprella@redhat.com>
@openshift-virtualization-qe-bot-5

Copy link
Copy Markdown

Clean rebase detected — no code changes compared to previous head (af75449).
The following labels were preserved: approved-jpeimer, lgtm-jpeimer, lgtm-josemacassan, lgtm-coderabbitai[bot], commented-akalenyu.

@ema-aka-young

Copy link
Copy Markdown
Contributor Author

/verified
on BM with

-s -o log_cli=true -m tier2 --jira --skip-deprecated-api-test --cluster-sanity-skip-check -k test_virtctl_libguestfs_with_specific_user --storage-class-matrix=ocs-storagecluster-ceph-rbd-virtualization --count=50

openshift-virtualization-tests-runner/5776

@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 tests/storage/test_libguestfs.py
@coderabbitai

coderabbitai Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Tip

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

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Get PR diff to find first changed line
gh pr view 5308 --repo RedHatQE/openshift-virtualization-tests --json files,headRefName

# Get the actual diff
gh api repos/RedHatQE/openshift-virtualization-tests/pulls/5308/files | jq '.[0] | {filename, patch, sha}'

Length of output: 1927


🏁 Script executed:

#!/bin/bash
# Check smoke and gating markers in test_libguestfs.py
rg -n 'pytest.mark.smoke|pytest.mark.gating|pytest.mark.tier' tests/storage/test_libguestfs.py

# Also check what tests exist in the file
rg -n 'def test_' tests/storage/test_libguestfs.py

# Check for virtctl_libguestfs_by_user fixture usage
rg -n 'virtctl_libguestfs_by_user' tests/storage/test_libguestfs.py

Length of output: 803


🏁 Script executed:

#!/bin/bash
# Post inline non-blocking review comment on the first changed line (position 1)
gh api \
  repos/RedHatQE/openshift-virtualization-tests/pulls/5308/reviews \
  --method POST \
  --field event="COMMENT" \
  --field commit_id="57ba960ce71cff981738f24db75101db846984db" \
  --field body="" \
  --field "comments[][path]=tests/storage/test_libguestfs.py" \
  --field "comments[][position]=1" \
  --field "comments[][body]=**Test Execution Plan**

**Run smoke tests: False**
No smoke-marked tests exist in `tests/storage/test_libguestfs.py`, and the changed symbol (`virtctl_libguestfs_by_user` fixture timeout) is not reachable from any smoke test path.

**Run gating tests: False**
No gating-marked tests exist in `tests/storage/test_libguestfs.py`, and no gating-marked test in the repository depends on the `virtctl_libguestfs_by_user` fixture.

**Affected tests to run**

\`\`\`
tests/storage/test_libguestfs.py::test_virtctl_libguestfs_with_specific_user  (tier2)
\`\`\`

This is the sole test that depends on the \`virtctl_libguestfs_by_user\` fixture where \`TIMEOUT_1MIN\`\`TIMEOUT_10MIN\` was applied. Run with a storage class that exercises the libguestfs pod path, for example:

\`\`\`
pytest -s -o log_cli=true -m tier2 --jira --skip-deprecated-api-test \
  -k test_virtctl_libguestfs_with_specific_user \
  --storage-class-matrix=ocs-storagecluster-ceph-rbd-virtualization
\`\`\`"

Length of output: 2238


🏁 Script executed:

#!/bin/bash
# Get the actual PR head commit SHA
gh api repos/RedHatQE/openshift-virtualization-tests/pulls/5308 --jq '.head.sha'

Length of output: 308


🏁 Script executed:

#!/bin/bash
# Use Python to construct and post the review via GitHub API
python3 << 'PYEOF'
import subprocess
import json

body = """**Test Execution Plan**

**Run smoke tests: False**
No smoke-marked tests exist in `tests/storage/test_libguestfs.py`, and the changed symbol (`virtctl_libguestfs_by_user` fixture timeout) is not reachable from any smoke test path.

**Run gating tests: False**
No gating-marked tests exist in `tests/storage/test_libguestfs.py`, and no gating-marked test in the repository depends on the `virtctl_libguestfs_by_user` fixture.

**Affected tests to run**

Length of output: 1166


🏁 Script executed:

#!/bin/bash
# Write the JSON payload to a temp file first, then post
cat > /tmp/review_payload.json << 'ENDJSON'
{
  "commit_id": "f405e94765d44c48a70f1be8c5b81835ff0135fb",
  "event": "COMMENT",
  "body": "",
  "comments": [
    {
      "path": "tests/storage/test_libguestfs.py",
      "position": 1,
      "body": "**Test Execution Plan**\n\n**Run smoke tests: False**\nNo smoke-marked tests exist in `tests/storage/test_libguestfs.py`, and the changed symbol (`virtctl_libguestfs_by_user` fixture timeout) is not reachable from any smoke test path.\n\n**Run gating tests: False**\nNo gating-marked tests exist in `tests/storage/test_libguestfs.py`, and no gating-marked test in the repository depends on the `virtctl_libguestfs_by_user` fixture.\n\n**Affected tests to run**\n\n```\ntests/storage/test_libguestfs.py::test_virtctl_libguestfs_with_specific_user  (tier2)\n```\n\nThis is the sole test that depends on the `virtctl_libguestfs_by_user` fixture where `TIMEOUT_1MIN` \u2192 `TIMEOUT_10MIN` was applied. Run with a storage class that exercises the libguestfs pod path:\n\n```\npytest -s -o log_cli=true -m tier2 --jira --skip-deprecated-api-test \\\n  -k test_virtctl_libguestfs_with_specific_user \\\n  --storage-class-matrix=ocs-storagecluster-ceph-rbd-virtualization\n```"
    }
  ]
}
ENDJSON

gh api repos/RedHatQE/openshift-virtualization-tests/pulls/5308/reviews \
  --method POST \
  --input /tmp/review_payload.json

Length of output: 3318



@rnetser

rnetser commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

@akalenyu

So IIUC just pulling the image could take up to 10 minutes? That sounds a bit off, how big is the image? You could try crictl on the ocp node and we could compare it to upstream. Just want to make sure we don't have a huge issue somewhere.

[cloud-user@worker1 ~]$ oc debug node/cnvqe-057.lab.eng.tlv2.redhat.com -- chroot /host crictl images | grep libguestfs
Starting pod/cnvqe-057labengtlv2redhatcom-debug-splbz ...
To use host binaries, run `chroot /host`. Instead, if you need to access host namespaces, run `nsenter -a -t 1`.

Removing debug pod ...
registry.redhat.io/container-native-virtualization/libguestfs-tools-rhel9                  <none>                                         0bc2221f5c35a       660MB

I could not pull the image for upstream but checking https://quay.io/repository/kubevirt/libguestfs-tools?tab=tags&tag=latest it looks to be 570MB.
Anyway, I think the timeout set to 10Min is conservative as it covering not only the pull of the image but also other operations that needs to be successful to have a Running Container. Replicating this manually, it never took more than 2/3 minutes but I wanted to align the test timeout with the production code.

There is not much happening other than the pull tbh, the entrypoint is bash

@akalenyu any concerns from your end or can this PR be merged?

@ema-aka-young

Copy link
Copy Markdown
Contributor Author

@rnetser we discussed this on Slack with @akalenyu . PR is not blocked, but is not actually fixing anything; it's just aligning the timeouts between production and test code. We can proceed with a deeper investigation orthogonally.

@akalenyu

akalenyu commented Jun 25, 2026

Copy link
Copy Markdown

@rnetser we discussed this on Slack with @akalenyu . PR is not blocked, but is not actually fixing anything; it's just aligning the timeouts between production and test code. We can proceed with a deeper investigation orthogonally.

Yep didn't mean to block, just a little sus this is slow and came up in tier-1 as well:
https://redhat.atlassian.net/browse/CNV-71385

@rnetser rnetser merged commit add7fc9 into RedHatQE:main Jun 25, 2026
19 checks passed
@openshift-virtualization-qe-bot-6

Copy link
Copy Markdown

Successfully removed PR tag: quay.io/openshift-cnv/openshift-virtualization-tests:pr-5308.

@ema-aka-young

Copy link
Copy Markdown
Contributor Author

/cherry-pick cnv-4.22

@openshift-virtualization-qe-bot

Copy link
Copy Markdown

Cherry-picked PR [Storage] Increase libguestfs pod timeout into cnv-4.22: #5426

rnetser pushed a commit that referenced this pull request Jun 29, 2026
…5426)

Cherry-pick from `main` branch, original PR:
#5308, PR
owner: ema-aka-young

Signed-off-by: Emanuele Prella <eprella@redhat.com>
Co-authored-by: Emanuele Prella <eprella@redhat.com>
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.