Skip to content

Commit 213110b

Browse files
arnongilboakubevirt-bot
authored and
kubevirt-bot
committed
Fix flaky DataImportCron volume snapshot test
As commented by Alex Kalenyuk: the condition check flakes because the switch to snapshot boot sources is almost instant. The DataImportCron never becomes "not ready" following the switch. We also moved the DIC "ready" check after the snapshot "ready" check, otherwise we may check it before it's "not ready", which checks nothing. Signed-off-by: Arnon Gilboa <agilboa@redhat.com>
1 parent 67a1595 commit 213110b

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

tests/dataimportcron_test.go

+1-3
Original file line numberDiff line numberDiff line change
@@ -732,11 +732,9 @@ var _ = Describe("DataImportCron", func() {
732732
// Now simulate an upgrade, where a new CDI version has identified
733733
// more storage types that scale better with snapshots
734734
configureStorageProfileResultingFormat(cdiv1.DataImportCronSourceFormatSnapshot)
735-
// Switches to not ready because the snapshot wasn't created yet
736-
waitForConditions(corev1.ConditionFalse, corev1.ConditionFalse)
737-
waitForConditions(corev1.ConditionFalse, corev1.ConditionTrue)
738735
// Check snapshot now exists and PVC is gone
739736
currentSource := verifySourceReady(cdiv1.DataImportCronSourceFormatSnapshot, currentImportDv)
737+
waitForConditions(corev1.ConditionFalse, corev1.ConditionTrue)
740738
// DataSource is updated to point to a snapshot
741739
dataSource, err := f.CdiClient.CdiV1beta1().DataSources(ns).Get(context.TODO(), cron.Spec.ManagedDataSource, metav1.GetOptions{})
742740
Expect(err).ToNot(HaveOccurred())

0 commit comments

Comments
 (0)