Skip to content

verify that idled PVCs are deleted#1249

Merged
MatousJobanek merged 5 commits into
codeready-toolchain:masterfrom
MatousJobanek:idler-pvc
Jan 15, 2026
Merged

verify that idled PVCs are deleted#1249
MatousJobanek merged 5 commits into
codeready-toolchain:masterfrom
MatousJobanek:idler-pvc

Conversation

@MatousJobanek
Copy link
Copy Markdown
Collaborator

@MatousJobanek MatousJobanek commented Jan 14, 2026

paired with codeready-toolchain/member-operator#722

SANDBOX-1573

Summary by CodeRabbit

  • Tests
    • Improved end-to-end test reliability by adding waits to ensure persistent volume claims (PVCs) are fully deleted during cleanup.
    • Test setup now creates and accounts for an accompanying PVC and Pod alongside data volumes to better mirror parallel workloads.
    • Overall synchronization and cleanup for parallel workload scenarios made more robust to reduce flakiness.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jan 14, 2026

Walkthrough

Adds PVC creation and a wait-for-PVC-deletion step to an existing e2e test and introduces a helper method to poll for PVC deletion in test support. Tests now create a PVC and Pod alongside a DataVolume and wait for PVC deletion during teardown.

Changes

Cohort / File(s) Summary
E2E test updates
test/e2e/parallel/user_workloads_test.go
Creates a PVC and Pod alongside a DataVolume in test setup, increments total pod count, and adds a wait step to ensure the PVC is deleted during teardown (mirrors DataVolume deletion wait).
Test wait helpers
testsupport/wait/member.go
Adds WaitUntilPVCDeleted(t *testing.T, name, namespace string) to poll until a PersistentVolumeClaim is NotFound, returning success on deletion or the observed error on timeout.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • jrosental
  • rajivnathan
  • mfrancisc

Poem

🐰
I hopped through tests with whiskers bright,
Watched PVCs vanish out of sight,
Pods counted up, then counted down,
Cleanup danced without a frown,
A tiny hop — the suite sleeps tight.

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'verify that idled PVCs are deleted' directly and clearly summarizes the main change: adding validation that PersistentVolumeClaims are deleted when idled.

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

✨ Finishing touches
  • 📝 Generate docstrings


📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5580b6b and 1818244.

📒 Files selected for processing (1)
  • testsupport/wait/member.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • testsupport/wait/member.go
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Build & push operator bundles & dashboard image for e2e tests

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


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.

Copy link
Copy Markdown

@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: 1

🤖 Fix all issues with AI agents
In `@test/e2e/parallel/user_workloads_test.go`:
- Around line 114-117: The test is waiting for a PVC deletion using
WaitUntilDataVolumeDeleted with dataVolumeRes and the wrong PVC name; change the
wait to target the core PVC resource and correct the name: use
memberAwait.Client (typed client) to wait for deletion of the
PersistentVolumeClaim named "test-idler-pvc-pvc" (or construct the name via
createPvcWithPod's name + "-pvc"), or if you prefer dynamic client use the PVC
GVR {Group:"", Version:"v1", Resource:"persistentvolumeclaims"}; replace the
WaitUntilDataVolumeDeleted call with a proper wait-for-deletion against the PVC
using memberAwait.Client or the correct GVR so the test observes actual PVC
removal.
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between eb77a8e and 19aa728.

📒 Files selected for processing (1)
  • test/e2e/parallel/user_workloads_test.go
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Build & push operator bundles & dashboard image for e2e tests
🔇 Additional comments (1)
test/e2e/parallel/user_workloads_test.go (1)

177-179: LGTM with note on naming convention.

The PVC and Pod creation logic is correct. Note that the PVC will be named "test-idler-pvc-pvc" (with -pvc suffix appended by createPvcWithPod), which needs to match the name used in the deletion wait at line 116.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

Comment thread test/e2e/parallel/user_workloads_test.go
Copy link
Copy Markdown

@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: 1

🤖 Fix all issues with AI agents
In `@testsupport/wait/member.go`:
- Line 1591: The current unconditional t.Logf("failed waiting for PVC '%s' to be
deleted in namespace '%s': %q", name, namespace, pvc) prints a failure even on
success; update the wait logic to only log that failure message inside the
error/failure branch (where the error variable is non-nil) and otherwise log a
success/info message (e.g., "succeeded waiting for PVC ... to be deleted") or
omit logging on success; ensure you reference the same variables pvc, name,
namespace and the t.Logf call so the fix replaces the unconditional log with
conditional logging based on the wait result.
♻️ Duplicate comments (1)
test/e2e/parallel/user_workloads_test.go (1)

115-117: Bug: PVC name mismatch - test will timeout waiting for non-existent resource.

The PVC is created with name "test-idler-pvc" + "-pvc" = "test-idler-pvc-pvc" at line 178 (via createPvcWithPod which appends -pvc to the name at line 423), but the wait expects "test-idler-pvc".

🐛 Proposed fix
 	// Wait for the PVC to be deleted
-	err = memberAwait.WaitUntilPVCDeleted(t, "test-idler-pvc", idler.Name)
+	err = memberAwait.WaitUntilPVCDeleted(t, "test-idler-pvc-pvc", idler.Name)
 	require.NoError(t, err)
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 19aa728 and 5580b6b.

📒 Files selected for processing (2)
  • test/e2e/parallel/user_workloads_test.go
  • testsupport/wait/member.go
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Build & push operator bundles & dashboard image for e2e tests
🔇 Additional comments (1)
test/e2e/parallel/user_workloads_test.go (1)

177-179: LGTM!

The PVC and Pod creation logic is correct. The nil owner creates a standalone PVC (not owned by a DataVolume), and the pod count is correctly incremented.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

Comment thread testsupport/wait/member.go Outdated
@sonarqubecloud
Copy link
Copy Markdown

@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Jan 15, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alexeykazakov, fbm3307, MatousJobanek

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [MatousJobanek,alexeykazakov,fbm3307]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@MatousJobanek MatousJobanek merged commit 8d62db8 into codeready-toolchain:master Jan 15, 2026
10 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants