@@ -176,9 +176,11 @@ func TestCreatePlanActiveFailoverScale(t *testing.T) {
176
176
}
177
177
newPlan , changed = createPlan (log , depl , nil , spec , status , nil , c )
178
178
assert .True (t , changed )
179
- require .Len (t , newPlan , 1 ) // Note: Downscaling is only down 1 at a time
180
- assert .Equal (t , api .ActionTypeRemoveMember , newPlan [0 ].Type )
179
+ require .Len (t , newPlan , 2 ) // Note: Downscaling is only down 1 at a time
180
+ assert .Equal (t , api .ActionTypeShutdownMember , newPlan [0 ].Type )
181
+ assert .Equal (t , api .ActionTypeRemoveMember , newPlan [1 ].Type )
181
182
assert .Equal (t , api .ServerGroupSingle , newPlan [0 ].Group )
183
+ assert .Equal (t , api .ServerGroupSingle , newPlan [1 ].Group )
182
184
}
183
185
184
186
// TestCreatePlanClusterScale creates a `cluster` deployment to test the creating of scaling plan.
@@ -261,12 +263,6 @@ func TestCreatePlanClusterScale(t *testing.T) {
261
263
api.MemberStatus {
262
264
ID : "cr1" ,
263
265
PodName : "coordinator1" ,
264
- Conditions : api.ConditionList {
265
- api.Condition {
266
- Type : api .ConditionTypeReady ,
267
- Status : v1 .ConditionTrue ,
268
- },
269
- },
270
266
},
271
267
api.MemberStatus {
272
268
ID : "cr2" ,
@@ -277,14 +273,15 @@ func TestCreatePlanClusterScale(t *testing.T) {
277
273
spec .Coordinators .Count = util .NewInt (1 )
278
274
newPlan , changed = createPlan (log , depl , nil , spec , status , nil , c )
279
275
assert .True (t , changed )
280
-
281
- fmt .Printf ("%v" , newPlan )
282
-
283
- require .Len (t , newPlan , 3 ) // Note: Downscaling is done 1 at a time
284
- assert .Equal (t , api .ActionTypeRemoveMember , newPlan [0 ].Type )
276
+ require .Len (t , newPlan , 5 ) // Note: Downscaling is done 1 at a time
277
+ assert .Equal (t , api .ActionTypeCleanOutMember , newPlan [0 ].Type )
285
278
assert .Equal (t , api .ActionTypeShutdownMember , newPlan [1 ].Type )
286
279
assert .Equal (t , api .ActionTypeRemoveMember , newPlan [2 ].Type )
280
+ assert .Equal (t , api .ActionTypeShutdownMember , newPlan [3 ].Type )
281
+ assert .Equal (t , api .ActionTypeRemoveMember , newPlan [4 ].Type )
287
282
assert .Equal (t , api .ServerGroupDBServers , newPlan [0 ].Group )
288
- assert .Equal (t , api .ServerGroupCoordinators , newPlan [1 ].Group )
289
- assert .Equal (t , api .ServerGroupCoordinators , newPlan [2 ].Group )
283
+ assert .Equal (t , api .ServerGroupDBServers , newPlan [1 ].Group )
284
+ assert .Equal (t , api .ServerGroupDBServers , newPlan [2 ].Group )
285
+ assert .Equal (t , api .ServerGroupCoordinators , newPlan [3 ].Group )
286
+ assert .Equal (t , api .ServerGroupCoordinators , newPlan [4 ].Group )
290
287
}
0 commit comments