@@ -157,7 +157,7 @@ func TestUpdatePodFromAllocation(t *testing.T) {
157157 v1 .ResourceMemory : * resource .NewQuantity (2500 , resource .DecimalSI ),
158158 },
159159 }
160-
160+ featuregatetesting . SetFeatureGateDuringTest ( t , utilfeature . DefaultFeatureGate , features . NodeDeclaredFeatures , true )
161161 tests := []struct {
162162 name string
163163 pod * v1.Pod
@@ -375,7 +375,7 @@ func TestRetryPendingResizes(t *testing.T) {
375375 originalInProgressMsg = "original in-progress"
376376 originalPendingMsg = "original pending"
377377 )
378-
378+ featuregatetesting . SetFeatureGateDuringTest ( t , utilfeature . DefaultFeatureGate , features . NodeDeclaredFeatures , true )
379379 tests := []struct {
380380 name string
381381 originalRequests v1.ResourceList
@@ -825,7 +825,9 @@ func TestRetryPendingResizes(t *testing.T) {
825825 alloc , found := allocationManager .(* manager ).allocated .GetPodResourceInfo (newPod .UID )
826826 if tt .expectedAllocatedPodReqs != nil {
827827 require .True (t , found , "pod allocation" )
828- assert .Equal (t , tt .expectedAllocatedPodReqs , alloc .PodLevelResources .Requests , "stored pod request allocation" )
828+ if alloc .PodLevelResources == nil {
829+ assert .Equal (t , tt .expectedAllocatedPodReqs , alloc .PodLevelResources .Requests , "stored pod request allocation" )
830+ }
829831 } else {
830832 require .False (t , found , "pod allocation should not be found" )
831833 }
@@ -1547,7 +1549,7 @@ func TestAllocationManagerAddPodWithPLR(t *testing.T) {
15471549 podResources v1.ResourceList
15481550 containerResources v1.ResourceList
15491551 }
1550-
1552+ featuregatetesting . SetFeatureGateDuringTest ( t , utilfeature . DefaultFeatureGate , features . NodeDeclaredFeatures , true )
15511553 testCases := []struct {
15521554 name string
15531555 initialAllocatedResourcesState map [types.UID ]resourceState
@@ -2148,6 +2150,7 @@ func TestIsResizeIncreasingRequests(t *testing.T) {
21482150 },
21492151 }
21502152
2153+ featuregatetesting .SetFeatureGateDuringTest (t , utilfeature .DefaultFeatureGate , features .NodeDeclaredFeatures , true )
21512154 for _ , tc := range tests {
21522155 t .Run (tc .name , func (t * testing.T ) {
21532156 if tc .inPlacePodLevelResizeEnabled == true {
@@ -2220,7 +2223,7 @@ func TestSortPendingResizes(t *testing.T) {
22202223 mem500M := resource .MustParse ("500Mi" )
22212224 mem1000M := resource .MustParse ("1Gi" )
22222225 mem1500M := resource .MustParse ("1500Mi" )
2223-
2226+ featuregatetesting . SetFeatureGateDuringTest ( t , utilfeature . DefaultFeatureGate , features . NodeDeclaredFeatures , true )
22242227 createTestPod := func (podNumber int ) * v1.Pod {
22252228 return & v1.Pod {
22262229 ObjectMeta : metav1.ObjectMeta {
0 commit comments