From f4c1244ab48bcbd97b65b6770bf7f55251669470 Mon Sep 17 00:00:00 2001 From: lowang-bh Date: Tue, 15 Aug 2023 22:47:15 +0800 Subject: [PATCH] update testcses Signed-off-by: lowang-bh --- pkg/controllers/job/job_controller_util_test.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/pkg/controllers/job/job_controller_util_test.go b/pkg/controllers/job/job_controller_util_test.go index 99415087a92..d8a8447dbe2 100644 --- a/pkg/controllers/job/job_controller_util_test.go +++ b/pkg/controllers/job/job_controller_util_test.go @@ -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{