Skip to content

Commit

Permalink
Fix flaky DataImportCron volume snapshot test
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
arnongilboa authored and kubevirt-bot committed Jan 6, 2025
1 parent 67a1595 commit 213110b
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions tests/dataimportcron_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -732,11 +732,9 @@ var _ = Describe("DataImportCron", func() {
// Now simulate an upgrade, where a new CDI version has identified
// more storage types that scale better with snapshots
configureStorageProfileResultingFormat(cdiv1.DataImportCronSourceFormatSnapshot)
// Switches to not ready because the snapshot wasn't created yet
waitForConditions(corev1.ConditionFalse, corev1.ConditionFalse)
waitForConditions(corev1.ConditionFalse, corev1.ConditionTrue)
// Check snapshot now exists and PVC is gone
currentSource := verifySourceReady(cdiv1.DataImportCronSourceFormatSnapshot, currentImportDv)
waitForConditions(corev1.ConditionFalse, corev1.ConditionTrue)
// DataSource is updated to point to a snapshot
dataSource, err := f.CdiClient.CdiV1beta1().DataSources(ns).Get(context.TODO(), cron.Spec.ManagedDataSource, metav1.GetOptions{})
Expect(err).ToNot(HaveOccurred())
Expand Down

0 comments on commit 213110b

Please sign in to comment.