@@ -105,7 +105,7 @@ var _ = Describe("Job E2E Test", func() {
105
105
err = waitPodGroupPending (context , pg )
106
106
Expect (err ).NotTo (HaveOccurred ())
107
107
108
- waitPodGroupUnschedulable (context , pg )
108
+ err = waitPodGroupUnschedulable (context , pg )
109
109
Expect (err ).NotTo (HaveOccurred ())
110
110
111
111
err = deleteReplicaSet (context , replicaset .Name )
@@ -325,4 +325,48 @@ var _ = Describe("Job E2E Test", func() {
325
325
err = waitTasksReadyEx (context , pg , expteced )
326
326
Expect (err ).NotTo (HaveOccurred ())
327
327
})
328
+
329
+ It ("Try to fit unassigned task with different resource requests in one loop" , func () {
330
+ context := initTestContext ()
331
+ defer cleanupTestContext (context )
332
+
333
+ slot := oneCPU
334
+ rep := clusterSize (context , slot )
335
+
336
+ replicaset := createReplicaSet (context , "rs-1" , rep / 2 , "nginx" , slot )
337
+ err := waitReplicaSetReady (context , replicaset .Name )
338
+ Expect (err ).NotTo (HaveOccurred ())
339
+
340
+ _ , pg := createJobEx (context , & jobSpec {
341
+ name : "multi-pod-job" ,
342
+ tasks : []taskSpec {
343
+ {
344
+ img : "nginx" ,
345
+ pri : masterPriority , // make sure task require more resource rank higher
346
+ min : rep / 2 + 1 ,
347
+ rep : rep / 2 + 1 ,
348
+ req : oneCPU ,
349
+ },
350
+ {
351
+ img : "nginx" ,
352
+ pri : workerPriority ,
353
+ min : 1 ,
354
+ rep : 1 ,
355
+ req : minMilliCPU ,
356
+ },
357
+ },
358
+ })
359
+
360
+ err = waitPodGroupPending (context , pg )
361
+ Expect (err ).NotTo (HaveOccurred ())
362
+
363
+ err = waitPodGroupUnschedulable (context , pg )
364
+ Expect (err ).NotTo (HaveOccurred ())
365
+
366
+ err = deleteReplicaSet (context , replicaset .Name )
367
+ Expect (err ).NotTo (HaveOccurred ())
368
+
369
+ err = waitPodGroupReady (context , pg )
370
+ Expect (err ).NotTo (HaveOccurred ())
371
+ })
328
372
})
0 commit comments