Skip to content

Commit

Permalink
update testcses
Browse files Browse the repository at this point in the history
Signed-off-by: lowang-bh <[email protected]>
  • Loading branch information
lowang-bh committed Aug 15, 2023
1 parent 7942a33 commit f4c1244
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions pkg/controllers/job/job_controller_util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -902,6 +902,23 @@ func TestTaskPriority_CalcPGMin(t *testing.T) {
"pods": *resource.NewQuantity(4, resource.DecimalSI), "count/pods": *resource.NewQuantity(4, resource.DecimalSI),
},
},
{ // jobMinAvailable < sum(taskMinAvailable)
Name: "job's min available is 2, master's is null and worker's is set to 1: min=2*master",
TasksPriority: []TaskPriority{
{
TaskSpec: master, priority: 2,
},
{
TaskSpec: worker,
},
},
JobMinMember: 2,
TasksMinAvailable: []*int32{nil, &oneMinAvailable},
ExpectValue: v1.ResourceList{
v1.ResourceCPU: *resource.NewMilliQuantity(100, resource.DecimalSI), "requests.cpu": *resource.NewMilliQuantity(100, resource.DecimalSI),
"pods": *resource.NewQuantity(2, resource.DecimalSI), "count/pods": *resource.NewQuantity(2, resource.DecimalSI),
},
},
{ // jobMinAvailable < sum(taskMinAvailable)
Name: "job's min available is 2, master's is null and worker's is set to 1: min=1*worker+1*master",
TasksPriority: []TaskPriority{
Expand Down

0 comments on commit f4c1244

Please sign in to comment.