Skip to content

Commit

Permalink
Pool test: Replace NewRandomVMWithDataVolume
Browse files Browse the repository at this point in the history
NewRandomVMWithDataVolume is requesting 1Gi
of memory. In case of pool tests this multiplies
by 2 leading to not enough memory in case of
parallel tests.

Signed-off-by: Luboslav Pivarc <[email protected]>
  • Loading branch information
xpivarc committed Jan 13, 2024
1 parent 7d5d1aa commit ef74911
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions tests/pool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"time"

"kubevirt.io/kubevirt/tests/decorators"
"kubevirt.io/kubevirt/tests/libdv"

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
Expand Down Expand Up @@ -116,11 +117,24 @@ var _ = Describe("[sig-compute]VirtualMachinePool", decorators.SigCompute, func(
newPersistentStorageVirtualMachinePool := func() *poolv1.VirtualMachinePool {
By("Create a new VirtualMachinePool with persistent storage")

vm, foundSC := tests.NewRandomVMWithDataVolume(cd.DataVolumeImportUrlForContainerDisk(cd.ContainerDiskCirros), util.NamespaceTestDefault)
if !foundSC {
sc, exists := libstorage.GetRWOFileSystemStorageClass()
if !exists {
Skip("Skip test when Filesystem storage is not present")
}

dataVolume := libdv.NewDataVolume(
libdv.WithRegistryURLSource(cd.DataVolumeImportUrlForContainerDisk(cd.ContainerDiskCirros)),
libdv.WithPVC(libdv.PVCWithStorageClass(sc)),
)

vm := libvmi.NewVirtualMachine(
libvmi.New(
libvmi.WithDataVolume("disk0", dataVolume.Name),
libvmi.WithResourceMemory("100M"),
),
libvmi.WithDataVolumeTemplate(dataVolume),
)

newPool := newPoolFromVMI(&v1.VirtualMachineInstance{
ObjectMeta: vm.Spec.Template.ObjectMeta,
Spec: vm.Spec.Template.Spec,
Expand Down

0 comments on commit ef74911

Please sign in to comment.