@@ -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,59 @@ 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
+ // Make sure podGroup are unschedulable not matter rep is odd or even
336
+ if rep % 2 == 1 {
337
+ rep = rep + 1
338
+ }
339
+
340
+ replicaset := createReplicaSet (context , "rs-1" , rep / 2 , "nginx" , slot )
341
+ err := waitReplicaSetReady (context , replicaset .Name )
342
+ Expect (err ).NotTo (HaveOccurred ())
343
+
344
+ _ , pg := createJobEx (context , & jobSpec {
345
+ name : "multi-task-diff-resource-job" ,
346
+ tasks : []taskSpec {
347
+ {
348
+ img : "nginx" ,
349
+ pri : masterPriority ,
350
+ min : rep / 2 ,
351
+ rep : rep / 2 ,
352
+ req : oneCPU ,
353
+ },
354
+ {
355
+ img : "nginx" ,
356
+ pri : workerPriority ,
357
+ min : 1 ,
358
+ rep : 1 ,
359
+ req : LessThanOneCPU ,
360
+ },
361
+ {
362
+ img : "nginx" ,
363
+ pri : workerPriority ,
364
+ min : 1 ,
365
+ rep : 1 ,
366
+ req : minMilliCPU ,
367
+ },
368
+ },
369
+ })
370
+
371
+ err = waitPodGroupPending (context , pg )
372
+ Expect (err ).NotTo (HaveOccurred ())
373
+
374
+ err = waitPodGroupUnschedulable (context , pg )
375
+ Expect (err ).NotTo (HaveOccurred ())
376
+
377
+ err = deleteReplicaSet (context , replicaset .Name )
378
+ Expect (err ).NotTo (HaveOccurred ())
379
+
380
+ err = waitPodGroupReady (context , pg )
381
+ Expect (err ).NotTo (HaveOccurred ())
382
+ })
328
383
})
0 commit comments