Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add checks for items length #416

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions test/e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,9 @@ var _ = Describe("controller", Ordered, func() {
// Here, we compare the accelerator memory with the memory fetched from parsing the GPU name
// Ex: Parsing the "NVIDIA A100-SXM4-40GB" GPU results in 40GB
// This gets compared with the memory that the daemonset patches the node
if len(instasliceObjs.Items) == 0 {
Fail("No Instaslice items found")
}
Expect(len(instasliceObjs.Items[0].Spec.MigGPUUUID)).To(Equal(2))
for _, instasliceObj := range instasliceObjs.Items {
memoryGB, err := daemonset.CalculateTotalMemoryGB(emulated, instasliceObj.Spec.MigGPUUUID)
Expand Down Expand Up @@ -628,6 +631,9 @@ var _ = Describe("controller", Ordered, func() {
}
err := k8sClient.List(ctx, instasliceObjs, &client.ListOptions{Namespace: namespace})
Expect(err).NotTo(HaveOccurred(), "Failed to retrieve Instaslice object")
if len(instasliceObjs.Items) == 0 {
Fail("No Instaslice items found")
}
referenceLen := len(instasliceObjs.Items[0].Spec.MigGPUUUID)
for _, obj := range instasliceObjs.Items {
currentLen := len(obj.Spec.MigGPUUUID)
Expand Down Expand Up @@ -684,6 +690,9 @@ var _ = Describe("controller", Ordered, func() {
podTemplateLongRunning := resources.GetTestGPULongRunningWorkload()
err := k8sClient.List(ctx, instasliceObjs, &client.ListOptions{Namespace: namespace})
Expect(err).NotTo(HaveOccurred(), "Failed to retrieve Instaslice object")
if len(instasliceObjs.Items) == 0 {
Fail("No Instaslice items found")
}
referenceLen := len(instasliceObjs.Items[0].Spec.MigGPUUUID)
for _, obj := range instasliceObjs.Items {
currentLen := len(obj.Spec.MigGPUUUID)
Expand Down