File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -215,6 +215,27 @@ func TestPoolIncreaseBatchSizeGreaterThanMaxPodIPCount(t *testing.T) {
215215 assert .Equal (t , initState .max , poolmonitor .spec .RequestedIPCount )
216216}
217217
218+ func TestIncreaseWithPendingRelease (t * testing.T ) {
219+ initState := testState {
220+ batch : 16 ,
221+ assigned : 16 ,
222+ allocated : 32 ,
223+ requestThresholdPercent : 50 ,
224+ releaseThresholdPercent : 150 ,
225+ max : 250 ,
226+ pendingRelease : 16 ,
227+ }
228+ _ , rc , mon := initFakes (initState )
229+ assert .NoError (t , rc .Reconcile (true ))
230+ assert .NoError (t , mon .reconcile (context .Background ()))
231+ assert .Equal (t , int64 (32 ), mon .spec .RequestedIPCount )
232+ assert .Len (t , mon .spec .IPsNotInUse , 16 )
233+ assert .NoError (t , rc .Reconcile (true ))
234+ assert .NoError (t , mon .reconcile (context .Background ()))
235+ assert .Equal (t , int64 (32 ), mon .spec .RequestedIPCount )
236+ assert .Empty (t , mon .spec .IPsNotInUse )
237+ }
238+
218239func TestPoolDecrease (t * testing.T ) {
219240 initState := testState {
220241 batch : 10 ,
You can’t perform that action at this time.
0 commit comments