Skip to content

Commit fa60457

Browse files
committed
update e2e testing
1 parent 845a83b commit fa60457

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

test/integration/singlecluster/scheduler/preemption_test.go

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ var _ = ginkgo.Describe("Preemption", func() {
274274
normalWl := utiltestingapi.MakeWorkload("normal-wl", ns.Name).
275275
Queue(kueue.LocalQueueName(q.Name)).
276276
Priority(0).
277-
Request(corev1.ResourceCPU, "2").
277+
Request(corev1.ResourceCPU, "4").
278278
Obj()
279279

280280
normalWl.Spec.PriorityClassRef = &kueue.PriorityClassRef{
@@ -289,8 +289,8 @@ var _ = ginkgo.Describe("Preemption", func() {
289289
ginkgo.By("Creating a suspended workload WITHOUT priority class")
290290
suspendedWl := utiltestingapi.MakeWorkload("suspended-wl", ns.Name).
291291
Queue(kueue.LocalQueueName(q.Name)).
292-
Request(corev1.ResourceCPU, "2").
293-
Active(false). // Suspended
292+
Request(corev1.ResourceCPU, "4").
293+
Active(false).
294294
Obj()
295295
util.MustCreate(ctx, k8sClient, suspendedWl)
296296

@@ -317,11 +317,19 @@ var _ = ginkgo.Describe("Preemption", func() {
317317
g.Expect(*wl.Spec.Priority).To(gomega.Equal(highPriority))
318318
}, util.Timeout, util.Interval).Should(gomega.Succeed())
319319

320+
ginkgo.By("Unsuspending the workload (set Active=true)")
321+
gomega.Eventually(func(g gomega.Gomega) {
322+
wl := &kueue.Workload{}
323+
g.Expect(k8sClient.Get(ctx, client.ObjectKeyFromObject(suspendedWl), wl)).To(gomega.Succeed())
324+
wl.Spec.Active = ptr.To(true)
325+
g.Expect(k8sClient.Update(ctx, wl)).To(gomega.Succeed())
326+
}, util.Timeout, util.Interval).Should(gomega.Succeed())
327+
320328
ginkgo.By("Verifying the normal priority workload gets preempted")
321329
util.ExpectWorkloadsToBePreempted(ctx, k8sClient, normalWl)
322330
util.FinishEvictionForWorkloads(ctx, k8sClient, normalWl)
323331

324-
ginkgo.By("Verifying the high-priority suspended workload gets admitted")
332+
ginkgo.By("Verifying the high-priority workload gets admitted")
325333
util.ExpectWorkloadsToHaveQuotaReservation(ctx, k8sClient, cq.Name, suspendedWl)
326334

327335
ginkgo.By("Verifying the normal priority workload is now pending")

0 commit comments

Comments
 (0)