Skip to content

Commit

Permalink
Fix flakes when using gigabytes intead of gibibytes (#2901)
Browse files Browse the repository at this point in the history
This is a partial backport of #2636
This tends to flake often, especially in OpenShift testing.

Signed-off-by: Alex Kalenyuk <akalenyu@redhat.com>
  • Loading branch information
akalenyu committed Sep 18, 2023
1 parent 5ff3c92 commit 16ff45d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/webhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,11 +213,11 @@ var _ = Describe("Clone Auth Webhook tests", func() {
})

DescribeTable("should deny/allow user when creating PVC clone datavolume", func(role *rbacv1.Role, saName, groupName string) {
srcPVCDef := utils.NewPVCDefinition("source-pvc", "1G", nil, nil)
srcPVCDef := utils.NewPVCDefinition("source-pvc", "1Gi", nil, nil)
srcPVCDef.Namespace = f.Namespace.Name
f.CreateAndPopulateSourcePVC(srcPVCDef, "fill-source", fmt.Sprintf("echo \"hello world\" > %s/data.txt", utils.DefaultPvcMountPath))

targetDV := utils.NewCloningDataVolume("target-dv", "1G", srcPVCDef)
targetDV := utils.NewCloningDataVolume("target-dv", "1Gi", srcPVCDef)

client, err := f.GetCdiClientForServiceAccount(targetNamespace.Name, serviceAccountName)
Expect(err).ToNot(HaveOccurred())
Expand Down Expand Up @@ -281,7 +281,7 @@ var _ = Describe("Clone Auth Webhook tests", func() {
Skip("Clone from volumesnapshot does not work without snapshot capable storage")
}

srcPVCDef := utils.NewPVCDefinition("source-pvc", "1G", nil, nil)
srcPVCDef := utils.NewPVCDefinition("source-pvc", "1Gi", nil, nil)
srcPVCDef.Namespace = f.Namespace.Name
pvc := f.CreateAndPopulateSourcePVC(srcPVCDef, "fill-source", fmt.Sprintf("echo \"hello world\" > %s/data.txt", utils.DefaultPvcMountPath))

Expand All @@ -301,7 +301,7 @@ var _ = Describe("Clone Auth Webhook tests", func() {
err = f.CrClient.Create(context.TODO(), snapshot)
Expect(err).ToNot(HaveOccurred())
volumeMode := v1.PersistentVolumeMode(v1.PersistentVolumeFilesystem)
targetDV := utils.NewDataVolumeForSnapshotCloningAndStorageSpec("target-dv", "1G", snapshot.Namespace, snapshot.Name, nil, &volumeMode)
targetDV := utils.NewDataVolumeForSnapshotCloningAndStorageSpec("target-dv", "1Gi", snapshot.Namespace, snapshot.Name, nil, &volumeMode)

client, err := f.GetCdiClientForServiceAccount(targetNamespace.Name, serviceAccountName)
Expect(err).ToNot(HaveOccurred())
Expand Down

0 comments on commit 16ff45d

Please sign in to comment.