File tree Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,6 @@ import (
2626 "github.com/NVIDIA/KAI-scheduler/pkg/scheduler/plugins/gpupack"
2727 "github.com/NVIDIA/KAI-scheduler/pkg/scheduler/plugins/gpusharingorder"
2828 "github.com/NVIDIA/KAI-scheduler/pkg/scheduler/plugins/gpuspread"
29- "github.com/NVIDIA/KAI-scheduler/pkg/scheduler/plugins/reflectjoborder"
3029 "github.com/NVIDIA/KAI-scheduler/pkg/scheduler/plugins/kubeflow"
3130 "github.com/NVIDIA/KAI-scheduler/pkg/scheduler/plugins/minruntime"
3231 "github.com/NVIDIA/KAI-scheduler/pkg/scheduler/plugins/nodeavailability"
@@ -37,6 +36,7 @@ import (
3736 "github.com/NVIDIA/KAI-scheduler/pkg/scheduler/plugins/priority"
3837 "github.com/NVIDIA/KAI-scheduler/pkg/scheduler/plugins/proportion"
3938 "github.com/NVIDIA/KAI-scheduler/pkg/scheduler/plugins/ray"
39+ "github.com/NVIDIA/KAI-scheduler/pkg/scheduler/plugins/reflectjoborder"
4040 "github.com/NVIDIA/KAI-scheduler/pkg/scheduler/plugins/resourcetype"
4141 "github.com/NVIDIA/KAI-scheduler/pkg/scheduler/plugins/snapshot"
4242 "github.com/NVIDIA/KAI-scheduler/pkg/scheduler/plugins/subgrouporder"
Original file line number Diff line number Diff line change @@ -11,8 +11,29 @@ import (
1111 "testing"
1212
1313 "github.com/NVIDIA/KAI-scheduler/pkg/scheduler/api/common_info"
14+ "github.com/NVIDIA/KAI-scheduler/pkg/scheduler/api/podgroup_info"
15+ "github.com/NVIDIA/KAI-scheduler/pkg/scheduler/conf"
16+ "github.com/NVIDIA/KAI-scheduler/pkg/scheduler/framework"
1417)
1518
19+ func TestJobOrderPlugin_OnSessionOpen (t * testing.T ) {
20+ ssn := & framework.Session {
21+ PodGroupInfos : map [common_info.PodGroupID ]* podgroup_info.PodGroupInfo {
22+ "pg1" : {UID : "pg1" , Priority : 5 , Queue : "q1" },
23+ "pg2" : {UID : "pg2" , Priority : 2 , Queue : "q2" },
24+ },
25+ Config : & conf.SchedulerConfiguration {
26+ QueueDepthPerAction : map [string ]int {"Allocate" : 10 },
27+ },
28+ }
29+ plugin := & JobOrderPlugin {}
30+ plugin .OnSessionOpen (ssn )
31+
32+ if plugin .ReflectJobOrder == nil {
33+ t .Fatalf ("ReflectJobOrder should be initialized" )
34+ }
35+ }
36+
1637// Test serveJobs returns correct JSON and status when ReflectJobOrder is set
1738func TestServeJobs_ReflectJobOrderReady (t * testing.T ) {
1839 plugin := & JobOrderPlugin {
You can’t perform that action at this time.
0 commit comments