diff --git a/test/e2e/autoscaling/cluster_size_autoscaling.go b/test/e2e/autoscaling/cluster_size_autoscaling.go index 6790f895603..6cfbc46cfe6 100644 --- a/test/e2e/autoscaling/cluster_size_autoscaling.go +++ b/test/e2e/autoscaling/cluster_size_autoscaling.go @@ -1008,7 +1008,7 @@ var _ = SIGDescribe("Cluster size autoscaling", framework.WithSlow(), func() { replicaCount := 2 * nodeCount reservedMemory := int(float64(replicaCount) * float64(0.7) * float64(memAllocatableMb)) cleanupFunc := ReserveMemoryWithSchedulerName(ctx, f, "memory-reservation", replicaCount, reservedMemory, false, 1, nonExistingBypassedSchedulerName) - defer cleanupFunc() + defer framework.ExpectNoError(cleanupFunc()) // Verify that cluster size is increased ginkgo.By("Waiting for cluster scale-up") sizeFunc := func(size int) bool { @@ -1022,7 +1022,7 @@ var _ = SIGDescribe("Cluster size autoscaling", framework.WithSlow(), func() { replicaCount := 1 reservedMemory := int(float64(0.5) * float64(memAllocatableMb)) cleanupFunc := ReserveMemoryWithSchedulerName(ctx, f, "memory-reservation", replicaCount, reservedMemory, false, 1, nonExistingBypassedSchedulerName) - defer cleanupFunc() + defer framework.ExpectNoError(cleanupFunc()) // Verify that cluster size is the same ginkgo.By(fmt.Sprintf("Waiting for scale up hoping it won't happen, polling cluster size for %s", scaleUpTimeout.String())) sizeFunc := func(size int) bool { @@ -1038,7 +1038,7 @@ var _ = SIGDescribe("Cluster size autoscaling", framework.WithSlow(), func() { reservedMemory := int(float64(replicaCount) * float64(0.7) * float64(memAllocatableMb)) schedulerName := "non-existent-scheduler-" + f.UniqueName cleanupFunc := ReserveMemoryWithSchedulerName(ctx, f, "memory-reservation", replicaCount, reservedMemory, false, 1, schedulerName) - defer cleanupFunc() + defer framework.ExpectNoError(cleanupFunc()) // Verify that cluster size is the same ginkgo.By(fmt.Sprintf("Waiting for scale up hoping it won't happen, polling cluster size for %s", scaleUpTimeout.String())) sizeFunc := func(size int) bool {