-
Notifications
You must be signed in to change notification settings - Fork 92
Unpend two kdm restore e2e tests now that phase 4 landed #2402
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -830,27 +830,20 @@ var _ = ginkgo.Describe("VM backup and restore tests", ginkgo.Ordered, func() { | |
| setupVmForRestoreTest(restoreNamespace, restoreVMName, restoreTemplate) | ||
| }) | ||
|
|
||
| ginkgo.PIt("restore run-state flip is not blocked by a stale sibling DataDownload from a different restore attempt — blocked on kubevirt-datamover-controller#73 phase 4 (restore-attempt-scoped sibling correlation, also resolves kubevirt-datamover-controller#169)", ginkgo.Label("virt", "kdm"), func() { | ||
| ginkgo.It("restore run-state flip is not blocked by a stale sibling DataDownload from a different restore attempt", ginkgo.Label("virt", "kdm"), func() { | ||
| // kubevirt-datamover-controller's VM run-state-restore flip | ||
| // (allSiblingDataDownloadsCompleted) currently correlates sibling | ||
| // (allSiblingDataDownloadsCompleted) used to correlate sibling | ||
| // DataDownloads purely by VM identity annotations | ||
| // (kubevirt-datamover.io/vm-name/vm-namespace), with no notion of which | ||
| // restore attempt a DataDownload belongs to. A stale, already-Failed | ||
| // DataDownload left over from an aborted prior restore attempt for a VM | ||
| // permanently blocks the flip for every future restore attempt of that VM, | ||
| // permanently blocked the flip for every future restore attempt of that VM, | ||
| // even a fully successful new one -- | ||
| // https://github.com/migtools/kubevirt-datamover-controller/issues/169. | ||
| // | ||
| // The fix (correlating by the restore's own velero.io/restore-uid label in | ||
| // addition to VM identity) is already implemented in | ||
| // kubevirt-datamover-controller#73 phase 4, the same branch the other two | ||
| // PIt placeholders below are waiting on. Scaffolded as real, compiling | ||
| // pending code (not deleted, not just a comment) so it's ready to flip to | ||
| // ginkgo.It once phase 4 lands -- asserting only the fixed, final behavior | ||
| // (the VM resumes despite a foreign-attempt decoy sibling), not the | ||
| // currently-buggy intermediate state, since asserting the bug itself would | ||
| // start failing the moment the fix merges with nothing forcing anyone to | ||
| // notice and update it. | ||
| // Fixed in kubevirt-datamover-controller#73 phase 4 (merged via #124/#186): | ||
| // sibling correlation now also matches the restore's own | ||
| // velero.io/restore-uid label, not just VM identity. | ||
| backupName := "cirros-stale-sibling-backup" | ||
| runKubevirtDMBackup(v, restoreNamespace, backupName, nil) | ||
|
|
||
|
|
@@ -933,22 +926,19 @@ var _ = ginkgo.Describe("VM backup and restore tests", ginkgo.Ordered, func() { | |
| return status == "Running", nil | ||
| }) | ||
| gomega.Expect(err).ToNot(gomega.HaveOccurred(), | ||
| "expected restored VM %s/%s to resume despite the foreign-attempt decoy sibling, once phase 4's restore-attempt-scoped correlation lands", restoreNamespace, restoreVMName) | ||
| "expected restored VM %s/%s to resume despite the foreign-attempt decoy sibling", restoreNamespace, restoreVMName) | ||
|
|
||
| err = v.RemoveVm(restoreNamespace, restoreVMName, 5*time.Minute) | ||
| gomega.Expect(err).To(gomega.BeNil(), "failed to remove VM %s/%s", restoreNamespace, restoreVMName) | ||
| err = lib.DeleteNamespace(v.Clientset, restoreNamespace) | ||
| gomega.Expect(err).To(gomega.BeNil(), "failed to delete namespace %s", restoreNamespace) | ||
| }) | ||
|
|
||
| ginkgo.PIt("restore a multi-PVC VM from a kubevirt-datamover CBT backup — blocked on kubevirt-datamover-controller#73 phase 4 (multi-disk restore hardening, not yet implemented)", ginkgo.Label("virt", "kdm"), func() { | ||
| ginkgo.It("restore a multi-PVC VM from a kubevirt-datamover CBT backup", ginkgo.Label("virt", "kdm"), func() { | ||
| // Phase 4 ("Multi-disk + PVC provisioning hardening") of | ||
| // https://github.com/migtools/kubevirt-datamover-controller/issues/73 has not | ||
| // landed yet — per its own exit criteria ("unit tests for multi-disk | ||
| // concurrency and sizing fallback behavior"), per-disk DataDownload isolation | ||
| // isn't hardened, so a real multi-disk restore can't be trusted to pass today. | ||
| // Scaffolded as real, compiling pending code (not deleted, not just a comment) | ||
| // so it's ready to flip to ginkgo.It once phase 4 lands. | ||
| // https://github.com/migtools/kubevirt-datamover-controller/issues/73 landed | ||
| // via #124/#186, hardening per-disk DataDownload isolation, so a real | ||
| // multi-disk restore can now be trusted to pass. | ||
|
Comment on lines
+937
to
+941
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚀 Performance & Scalability | 🟠 Major | 🏗️ Heavy lift Isolate the multi-PVC setup from the shared CirrOS fixture. This 🤖 Prompt for AI Agents🩺 Stability & Availability | 🟠 Major | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
rg -n -C 12 \
'func tearDownBackupAndRestore|tearDownBackupAndRestore|func DeleteVeleroBackupAndRestore|DeleteVeleroBackupAndRestore' \
tests/e2eRepository: openshift/oadp-operator Length of output: 45177 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '%s\n' '--- target suite structure and shared setup ---'
ast-grep outline tests/e2e/virt_backup_restore_suite_test.go --match 'BeforeEach' --view expanded
sed -n '300,470p' tests/e2e/virt_backup_restore_suite_test.go
printf '%s\n' '--- target test and neighboring test ---'
sed -n '800,1030p' tests/e2e/virt_backup_restore_suite_test.go
printf '%s\n' '--- case update and teardown definitions ---'
rg -n -C 8 \
'lastBRCase|updateLastBRcase|func tearDownBackupAndRestore|func runVmBackupAndRestore|func prepareBackupAndRestore' \
tests/e2e/virt_backup_restore_suite_test.go tests/e2e/backup_restore_suite_test.goRepository: openshift/oadp-operator Length of output: 42218 Register cleanup for the multi-PVC test. The suite-level teardown does not delete 🤖 Prompt for AI AgentsSource: Coding guidelines |
||
| multiPvcNamespace := "cirros-multipvc-cbt-test" | ||
| multiPvcVMName := "cirros-multipvc-cbt-test" | ||
| multiPvcTemplate := "./sample-applications/virtual-machines/cirros-test/cirros-test-multipvc-cbt.yaml" | ||
|
|
@@ -987,7 +977,7 @@ var _ = ginkgo.Describe("VM backup and restore tests", ginkgo.Ordered, func() { | |
| gomega.Eventually(lib.IsRestoreDone(dpaCR.Client, namespace, restoreName), 45*time.Minute, time.Second*10).Should(gomega.BeTrue()) | ||
| succeeded, err := lib.IsRestoreCompletedSuccessfully(kubernetesClientForSuiteRun, dpaCR.Client, namespace, restoreName) | ||
| gomega.Expect(err).ToNot(gomega.HaveOccurred()) | ||
| gomega.Expect(succeeded).To(gomega.BeTrue(), "expected both disks' DataDownloads to complete once phase 4 lands") | ||
| gomega.Expect(succeeded).To(gomega.BeTrue(), "expected both disks' DataDownloads to complete") | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
rg -n -C 15 \
'func IsRestoreCompletedSuccessfully|IsRestoreCompletedSuccessfully|GetDataDownloadForRestore|DataDownloadList' \
tests/e2e/lib tests/e2e/virt_backup_restore_suite_test.goRepository: openshift/oadp-operator Length of output: 29735 🏁 Script executed: #!/bin/bash
set -euo pipefail
python3 - <<'PY'
from pathlib import Path
import re
restore = Path("tests/e2e/lib/restore.go").read_text()
test = Path("tests/e2e/virt_backup_restore_suite_test.go").read_text()
m = re.search(
r'func IsRestoreCompletedSuccessfully\(.*?\n\}',
restore,
re.S,
)
print("IsRestoreCompletedSuccessfully:")
print(m.group(0) if m else "not found")
print("\nDataDownload helpers and list usage:")
for path in Path("tests/e2e").rglob("*.go"):
text = path.read_text()
for i, line in enumerate(text.splitlines(), 1):
if "DataDownloadList" in line or "GetDataDownloadForRestore" in line:
print(f"{path}:{i}:{line.strip()}")
print("\nMulti-PVC assertion context:")
lines = test.splitlines()
for i in range(974, 982):
print(f"{i+1}:{lines[i]}")
PYRepository: openshift/oadp-operator Length of output: 2474 Assert both DataDownloads explicitly.
🤖 Prompt for AI Agents |
||
|
|
||
| err = v.RemoveVm(multiPvcNamespace, multiPvcVMName, 5*time.Minute) | ||
| gomega.Expect(err).To(gomega.BeNil()) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Update the stale pending-suite documentation.
The new
Itis active, but the enclosingDescribeat Line [794] and nearby comments at Lines [787-789] and [917-920] still describe this scenario as pending or as a futurePItconversion. Ginkgo output and source documentation will contradict the active test status. Rename the suite and update the stale comments.🤖 Prompt for AI Agents