@@ -16,95 +16,95 @@ limitations under the License.
1616
1717package flowcontroller
1818
19- import (
20- "testing"
21- "time"
19+ // import (
20+ // "testing"
21+ // "time"
2222
23- "github.com/google/go-cmp/cmp"
24- v1alpha2 "sigs.k8s.io/gateway-api-inference-extension/api/v1alpha2"
25- )
23+ // "github.com/google/go-cmp/cmp"
24+ // v1alpha2 "sigs.k8s.io/gateway-api-inference-extension/api/v1alpha2"
25+ // )
2626
27- func TestFlowControllerConfig_validateAndApplyDefaults (t * testing.T ) {
28- tests := []struct {
29- name string
30- input * FlowControllerConfig
31- expected * FlowControllerConfig
32- }{
33- {
34- name : "Empty config" ,
35- input : & FlowControllerConfig {},
36- expected : & FlowControllerConfig {
37- MaxBytesPerCriticality : map [v1alpha2.Criticality ]uint64 {
38- v1alpha2 .Critical : DefaultCriticalCapacityBytes ,
39- v1alpha2 .Standard : DefaultStandardCapacityBytes ,
40- v1alpha2 .Sheddable : DefaultSheddableCapacityBytes ,
41- },
42- MaxGlobalBytes : 0 , // Default is 0
43- DefaultQueueTTL : DefaultQueueTTL ,
44- ExpiryCleanupInterval : DefaultExpiryCleanupInterval ,
45- InterModelFairnessPolicy : PolicyFCFS ,
46- PreemptionStrategy : PolicyNone ,
47- },
48- },
49- {
50- name : "Partially filled config" ,
51- input : & FlowControllerConfig {
52- MaxBytesPerCriticality : map [v1alpha2.Criticality ]uint64 {
53- v1alpha2 .Critical : 100 , // Custom critical
54- },
55- MaxGlobalBytes : 5000 ,
56- DefaultQueueTTL : 5 * time .Second ,
57- InterModelFairnessPolicy : PolicyRoundRobin ,
58- },
59- expected : & FlowControllerConfig {
60- MaxBytesPerCriticality : map [v1alpha2.Criticality ]uint64 {
61- v1alpha2 .Critical : 100 , // Keep custom
62- v1alpha2 .Standard : DefaultStandardCapacityBytes ,
63- v1alpha2 .Sheddable : DefaultSheddableCapacityBytes ,
64- },
65- MaxGlobalBytes : 5000 , // Keep custom
66- DefaultQueueTTL : 5 * time .Second , // Keep custom
67- ExpiryCleanupInterval : DefaultExpiryCleanupInterval ,
68- InterModelFairnessPolicy : PolicyRoundRobin , // Keep custom
69- PreemptionStrategy : PolicyNone ,
70- },
71- },
72- {
73- name : "All values specified" ,
74- input : & FlowControllerConfig {
75- MaxBytesPerCriticality : map [v1alpha2.Criticality ]uint64 {
76- v1alpha2 .Critical : 10 ,
77- v1alpha2 .Standard : 20 ,
78- v1alpha2 .Sheddable : 30 ,
79- },
80- MaxGlobalBytes : 60 ,
81- DefaultQueueTTL : 1 * time .Minute ,
82- ExpiryCleanupInterval : 10 * time .Second ,
83- InterModelFairnessPolicy : PolicyRoundRobin ,
84- PreemptionStrategy : PolicyEvictOldest ,
85- },
86- expected : & FlowControllerConfig { // Expect no changes
87- MaxBytesPerCriticality : map [v1alpha2.Criticality ]uint64 {
88- v1alpha2 .Critical : 10 ,
89- v1alpha2 .Standard : 20 ,
90- v1alpha2 .Sheddable : 30 ,
91- },
92- MaxGlobalBytes : 60 ,
93- DefaultQueueTTL : 1 * time .Minute ,
94- ExpiryCleanupInterval : 10 * time .Second ,
95- InterModelFairnessPolicy : PolicyRoundRobin ,
96- PreemptionStrategy : PolicyEvictOldest ,
97- },
98- },
99- }
27+ // func TestFlowControllerConfig_validateAndApplyDefaults(t *testing.T) {
28+ // tests := []struct {
29+ // name string
30+ // input *FlowControllerConfig
31+ // expected *FlowControllerConfig
32+ // }{
33+ // {
34+ // name: "Empty config",
35+ // input: &FlowControllerConfig{},
36+ // expected: &FlowControllerConfig{
37+ // MaxBytesPerCriticality: map[v1alpha2.Criticality]uint64{
38+ // v1alpha2.Critical: DefaultCriticalCapacityBytes,
39+ // v1alpha2.Standard: DefaultStandardCapacityBytes,
40+ // v1alpha2.Sheddable: DefaultSheddableCapacityBytes,
41+ // },
42+ // MaxGlobalBytes: 0, // Default is 0
43+ // DefaultQueueTTL: DefaultQueueTTL,
44+ // ExpiryCleanupInterval: DefaultExpiryCleanupInterval,
45+ // InterModelFairnessPolicy: PolicyFCFS,
46+ // PreemptionStrategy: PolicyNone,
47+ // },
48+ // },
49+ // {
50+ // name: "Partially filled config",
51+ // input: &FlowControllerConfig{
52+ // MaxBytesPerCriticality: map[v1alpha2.Criticality]uint64{
53+ // v1alpha2.Critical: 100, // Custom critical
54+ // },
55+ // MaxGlobalBytes: 5000,
56+ // DefaultQueueTTL: 5 * time.Second,
57+ // InterModelFairnessPolicy: PolicyRoundRobin,
58+ // },
59+ // expected: &FlowControllerConfig{
60+ // MaxBytesPerCriticality: map[v1alpha2.Criticality]uint64{
61+ // v1alpha2.Critical: 100, // Keep custom
62+ // v1alpha2.Standard: DefaultStandardCapacityBytes,
63+ // v1alpha2.Sheddable: DefaultSheddableCapacityBytes,
64+ // },
65+ // MaxGlobalBytes: 5000, // Keep custom
66+ // DefaultQueueTTL: 5 * time.Second, // Keep custom
67+ // ExpiryCleanupInterval: DefaultExpiryCleanupInterval,
68+ // InterModelFairnessPolicy: PolicyRoundRobin, // Keep custom
69+ // PreemptionStrategy: PolicyNone,
70+ // },
71+ // },
72+ // {
73+ // name: "All values specified",
74+ // input: &FlowControllerConfig{
75+ // MaxBytesPerCriticality: map[v1alpha2.Criticality]uint64{
76+ // v1alpha2.Critical: 10,
77+ // v1alpha2.Standard: 20,
78+ // v1alpha2.Sheddable: 30,
79+ // },
80+ // MaxGlobalBytes: 60,
81+ // DefaultQueueTTL: 1 * time.Minute,
82+ // ExpiryCleanupInterval: 10 * time.Second,
83+ // InterModelFairnessPolicy: PolicyRoundRobin,
84+ // PreemptionStrategy: PolicyEvictOldest,
85+ // },
86+ // expected: &FlowControllerConfig{ // Expect no changes
87+ // MaxBytesPerCriticality: map[v1alpha2.Criticality]uint64{
88+ // v1alpha2.Critical: 10,
89+ // v1alpha2.Standard: 20,
90+ // v1alpha2.Sheddable: 30,
91+ // },
92+ // MaxGlobalBytes: 60,
93+ // DefaultQueueTTL: 1 * time.Minute,
94+ // ExpiryCleanupInterval: 10 * time.Second,
95+ // InterModelFairnessPolicy: PolicyRoundRobin,
96+ // PreemptionStrategy: PolicyEvictOldest,
97+ // },
98+ // },
99+ // }
100100
101- for _ , tt := range tests {
102- t .Run (tt .name , func (t * testing.T ) {
103- cfg := tt .input
104- cfg .validateAndApplyDefaults ()
105- if diff := cmp .Diff (tt .expected , cfg ); diff != "" {
106- t .Errorf ("validateAndApplyDefaults() mismatch (-want +got):\n %s" , diff )
107- }
108- })
109- }
110- }
101+ // for _, tt := range tests {
102+ // t.Run(tt.name, func(t *testing.T) {
103+ // cfg := tt.input
104+ // cfg.validateAndApplyDefaults()
105+ // if diff := cmp.Diff(tt.expected, cfg); diff != "" {
106+ // t.Errorf("validateAndApplyDefaults() mismatch (-want +got):\n%s", diff)
107+ // }
108+ // })
109+ // }
110+ // }
0 commit comments