Skip to content

Commit

Permalink
Work around common snapshot controller issue in tests (#2996)
Browse files Browse the repository at this point in the history
This issue prevents the common csi snapshot controller from removing it's
PVC finalizer:
kubernetes-csi/external-snapshotter#957

This causes us some pain in testing:
https://search.ci.kubevirt.io/?search=dataimportcron_test.go%3A138&maxAge=336h&context=1&type=bug%2Bissue%2Bjunit&name=&excludeName=&maxMatches=5&maxBytes=20971520&groupBy=job
so let's try working around it.

Signed-off-by: Alex Kalenyuk <akalenyu@redhat.com>
Co-authored-by: Alex Kalenyuk <akalenyu@redhat.com>
  • Loading branch information
kubevirt-bot and akalenyu committed Nov 22, 2023
1 parent 6cb6a1b commit 020fc30
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion tests/dataimportcron_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,16 @@ var _ = Describe("DataImportCron", func() {
},
}
snapshot = utils.WaitSnapshotReady(f.CrClient, snapshot)
deleted, err := utils.WaitPVCDeleted(f.K8sClient, name, ns, 2*time.Minute)
deleted, err := utils.WaitPVCDeleted(f.K8sClient, name, ns, 30*time.Second)
if err != nil {
// work around https://github.com/kubernetes-csi/external-snapshotter/issues/957
// it does converge after the resync period of snapshot controller (15mins)
cc.AddAnnotation(snapshot, "workaround", "triggersync")
err = f.CrClient.Update(context.TODO(), snapshot)
Expect(err).ToNot(HaveOccurred())
// try again
deleted, err = utils.WaitPVCDeleted(f.K8sClient, name, ns, 30*time.Second)
}
Expect(err).ToNot(HaveOccurred())
Expect(deleted).To(BeTrue())
// check pvc is not recreated
Expand Down

0 comments on commit 020fc30

Please sign in to comment.